Is there any way to have a message box pop up AFTER ALL additions or changes are entered on both a main form AND a subform?
I realize that when you move from a main form to a subform Access automatically saves the current record before changes can be made to the subform. However, to the user both forms are one record that is being added/changed and I would like to have the message box reflect this if at all possible.
Record source for the main form is tblMain
Record source for the subform is a junction table (tblNewJunction) that creates a many to many relationship with tblMain and tblDistinctTableNames.
This simple message box code fires when tabbing out of the main form into the subform:
I could change the message to “Do you wish to save your changes and proceed to add table names to the new record?”, but would like to avoid this “intermediate message box” and just have one yes/no message box pop up when the user is finished entering data on both the main form AND the subform.
Any suggestions would be greatly appreciated.
I realize that when you move from a main form to a subform Access automatically saves the current record before changes can be made to the subform. However, to the user both forms are one record that is being added/changed and I would like to have the message box reflect this if at all possible.
Record source for the main form is tblMain
Record source for the subform is a junction table (tblNewJunction) that creates a many to many relationship with tblMain and tblDistinctTableNames.
This simple message box code fires when tabbing out of the main form into the subform:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & vbCrLf & "Do you wish to save your changes?"
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Changes?") = vbYes Then
'do nothing
Else
DoCmd.RunCommand acCmdUndo
End If
Any suggestions would be greatly appreciated.