Save As..

devolved_one

New member
Local time
Today, 15:18
Joined
Mar 21, 2000
Messages
8
How do you preform a save as on a form using VBA code, or maybe a macro (whichever is easiest)???

Thanks
 
The following will help. You can apply this to the On-click of a save or exit button, or the close event of the form. For this example I have this code attached to a Save Button on my form and this is the Event Procedure for the On-Click. My button's name is also called Save.

Private Sub Save_Click()
On Error GoTo Err_Save_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_Save_Click:
Exit Sub

Err_Save_Click:
MsgBox Err.Description
Resume Exit_Save_Click

End Sub

Good Luck
 
Ok. Carol that is one method, but here is a shorter one

Docmd.RunCommand acCmdSaveAs 'Save As something else
Docmd.RunCommand acCmdSaveRecord 'Saves the Current Record

There are others.

P.S. this is the recommended approach by Microsoft.
 

Users who are viewing this thread

Back
Top Bottom