Command buttons Save and Delete

BittenApple
BronzeLounger
Posts: 1498
Joined: 01 Mar 2015, 02:03

Command buttons Save and Delete

Post by BittenApple »

Hello all,

I have inserted Delete and Save button on a form in Access, without attaching any code or macro just through a wizard in Design tab. Should I attach any code or macro to the buttons?
When I use save command button, as if the button is blank, but I can see the record is saved to the table. Anyway, when we put data through the form in a table, the data goes into the table and actually we don't need a save button, I think the save button here plays a role of guarantor to show the end user the record is saved. And Delete button clears data from the form.

Regards,
elppa

Mark L
3StarLounger
Posts: 331
Joined: 11 Feb 2010, 03:55
Location: Land O Lakes, FL

Re: Command buttons Save and Delete

Post by Mark L »

You don't actually need a Save button; assuming you have a bound form, Access will automatically save the record when you move off of it (such as closing the form, using navigation buttons to move to another record, moving to a subform, etc. I frequently put both Save and Undo buttons on a form that only become visible once the use has made the form dirty. This is just as a convenience to the user; both as a notice that something has changed, and as a quick way to either Save or Cancel the changes.
Mark Liquorman
Land O Lakes, FL
see my website http://www.liquorman.net for Access Tips and Tricks, and for my Liquorman Utilities.

BittenApple
BronzeLounger
Posts: 1498
Joined: 01 Mar 2015, 02:03

Re: Command buttons Save and Delete

Post by BittenApple »

Hello Mark,

Thanks for response,
Yes, this is exactly what I mean, I just put those just for a convenience to the user.
Wouldn't it be better to attach a macro to those buttons?

Regards,
elppa

User avatar
HansV
Administrator
Posts: 78485
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Command buttons Save and Delete

Post by HansV »

If you have 'Use Control Wizards' turned on, Access will automatically create code or a macro when you place a Delete Record or Save Record button on a form.
S1489.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans