F
FA
I have two command bottons on the forms
1)
Private Sub Save_Click()
Dim Answer As Integer
Answer = MsgBox("Are you sure you want to save this record?", 36,
"Enter New Record ")
If Answer = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
End If
2)
Private Sub Close_Click()
On Error GoTo Err_Command94_Click
DoCmd.Close
Exit_Command94_Click:
Exit Sub
Err_Command94_Click:
MsgBox Err.Description
Resume Exit_Command94_Click
I want to have a functionality where if user add/update record and
click the Close command button without clicking the Save command
botton, it should prompt the user if he/she wants to save the record.
If the user click the save command button after adding/updating a
record and hit the close command button, then they should not be asked
to save the record.
Any help would be greatly appreciated.
Thanks
1)
Private Sub Save_Click()
Dim Answer As Integer
Answer = MsgBox("Are you sure you want to save this record?", 36,
"Enter New Record ")
If Answer = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
End If
2)
Private Sub Close_Click()
On Error GoTo Err_Command94_Click
DoCmd.Close
Exit_Command94_Click:
Exit Sub
Err_Command94_Click:
MsgBox Err.Description
Resume Exit_Command94_Click
I want to have a functionality where if user add/update record and
click the Close command button without clicking the Save command
botton, it should prompt the user if he/she wants to save the record.
If the user click the save command button after adding/updating a
record and hit the close command button, then they should not be asked
to save the record.
Any help would be greatly appreciated.
Thanks