"Save Record" Command Button

H

H E Johnson

I just want to know what exactly is the functionality of having a "save
record" option when using the Button Wizard? Doesn't Access automatically
save each field in your form once you tab/click out of it? I didn't think
there was any way to stop this "auto-saving" so why is there a "Save Record"
command?
 
T

tina

when you enter table data via a form, Access doesn't save field data
individually - it saves an entire record when you move to another record,
move between a mainform and subform, close the form, set the Dirty property
to False, or explicitly save the record from the menu bar, tool bar, or any
other means that uses a macro or VBA code to save. you can prevent the
automatic save at the form level by writing code in the form's BeforeUpdate
event.

as for *why* you would want to, or need to - well, there could be a lot of
reasons, just depends on the situation. if your users don't have a specific
need for a Save button, just don't put one on the form.

hth
 
B

BruceM

In my experience some users just want to see a Save button. They are in the
habit of saving with Word, Excel, et al, so they want to do the same with
Access. No amount of explanation about Access saving automatically will
satisfy them. If a button already has the effect of saving the record (e.g.
a New Record button) I sometimes just add Save to the label or caption. On
a form for data entry only I tend to label the New Record button as the Save
button, even though the code behind the button advances to a new record
rather than explicitly saving.
 
D

Douglas J. Steele

The form's BeforeUpdate event will fire before the data's saved. In theory,
you could cancel the event unless they've used the Save button, but
realistically you're better living with the rules of Access. (You can also
used unbound forms, but they involve far more coding)
 
T

tina

yes, as i said in my previous post: by writing code in the form's
BeforeUpdate event procedure.

hth
 
M

mayshara

i wonder if it's possible to have one "SAVE" button in a form that does the saving for all (all changes in any field). i've tried the BeforeUpdate event procedure as advised but i find it troublesome since the save window (asking if i want to save or not) pop-ups everytime i move the cursor (even if i clicked anywhere on the form) and i haven't done updating the rest of the form yet. any help would be highly appreciated. :)



Posted as a reply to:

Re: "Save Record" Command Button

yes, as i said in my previous post: by writing code in the form'
BeforeUpdate event procedure

ht

th
wit
(e.g
O
Sav
record
o
lot o
"sav
automaticall
think

EggHeadCafe - Software Developer Portal of Choice
WCF Workflow Services Using External Data Exchange
http://www.eggheadcafe.com/tutorial...a-6dafb17b6d74/wcf-workflow-services-usi.aspx
 
J

Jeanette Cunningham

Hi mayshara,
the save window only pops up after you have made changes to the design of
the form in form view, or changes to the code. Is this what you were doing
just before the save window popped up?



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
G

Gina Whipp

mayshara,

Why would you need a Save button? Basically, the record is *saved* once the
field has data entered. While you can Undo the record because it is not yet
*committed* to the table until you go to the next record which, in essence,
*saves* it. So perhaps you should explain what it is you are trying to
accomplish...

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
J

John W. Vinson

i wonder if it's possible to have one "SAVE" button in a form that does the saving for all
(all changes in any field). i've tried the BeforeUpdate event procedure as
advised but i find it troublesome since the save window (asking if i want to
save or not) pop-ups everytime i move the cursor (even if i clicked anywhere
on the form) and i haven't done updating the rest of the form yet. any help
would be highly appreciated. :)

Yes. You can use either a Macro, using the Command action, SaveRecord as the
parameter; or VBA code in the button's Click event:

Private Sub cmdSave_Click(*)
DoCmd.RunCommand acCmdSaveRecord
End Sub

Either will trigger the form's Before Update event, which might have
validation code or whatever else you put there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top