View Full Version : Save As..


devolved_one
03-24-2000, 09:33 AM
How do you preform a save as on a form using VBA code, or maybe a macro (whichever is easiest)???

Thanks

Carol
03-24-2000, 01:34 PM
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

Travis
03-24-2000, 06:27 PM
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.