I have a command button that connects two forms. I need to save form1 before opening form2. I added a line for saving the record and then open form2 as following but it doesn't work.
Any suggestions?
Thank you in advance.
Any suggestions?
Code:
Private Sub Command30_Click()
On Error GoTo Err_Command30_Click
Dim stDocName As String
Dim stLinkCriteria As String
'Saving record
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
stDocName = "form2"
stLinkCriteria = "[RecordID]=" & Me![RecordID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command30_Click:
Exit Sub
Err_Command30_Click:
MsgBox Err.Description
Resume Exit_Command30_Click
End Sub
Thank you in advance.