Save Button

benjee

Personal Jesus
Local time
Today, 23:06
Joined
Mar 19, 2003
Messages
53
Hello,

Currrently working on a form with numerous fields.

My question is how can i create a Save button that saves information entered into the form rather than going to the tool bar and 'Save record'?

Ben
 
Why do you need an explicit save? The data is automatically saved when you close the form, or you move to a different record.
 
Hi Neil,

To set the scenario out, ive created a 'customer details form' that links to a 'job details form'

When i added a new customer entered the details etc, and went to Add Job the new details were not appearing on the Job Details form.

I thought a Save button might be the appropriate answer. Ive tried this code out and it seems to work ok:-

Private Sub Command51_Click()
On Error GoTo Err_Command51_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_Command51_Click:
Exit Sub

Err_Command51_Click:
MsgBox Err.Description
Resume Exit_Command51_Click

End Sub
 
The wizard code is obsolete now, when Microsoft employees start talking to each other again they'll get around to changing it.
Replace your do menu etc with
DoCmd.RunCommand acCmdSave
 
When you say the forms are linked, how? neileg is correct in that records are automatically saved. If you're entering data in the customers form then close it and then open the jobs form you should be able to pull that information. If the jobs form is already open you might need to requery it.

Nevertheless if you want a simple save command use

DoCmd.RunCommand accmdSaveRecord
 
neileg is correct in that records are automatically saved.
not in this case, benjee is using the correct method, just the code needs updating
 
Cheers guys,

ive implemented the: -

DoCmd.RunCommand accmdSaveRecord


Ben
 

Users who are viewing this thread

Back
Top Bottom