Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdSave_Click:
Exit Sub
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub
So his code isn't necessarily old.Dim mySomething as string
Dim MyOtherValue as string
Dim myNumber as long
mySomething = me.txtSomething 'save the value in the control for use in a second
MyOtherValue = me.txtOtherValue 'save the value in the control for use in a second
MyNumber = me.txtNumber 'save the value in the control for use in a second
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdRecordsGoToNew
me.txtSomething=mySomething 'copy your saved value back
me.txtOtherValue=MyOtherValue 'copy your saved value back
me.txtNumber=MyNumber 'copy your saved value back
ASKER
ASKER
ASKER
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
Open in new window