A family of Microsoft relational database management systems designed for ease of use.
That's a contradictory requirement, sorry.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi
I have a form which user uses to enter a new record.
So in the form before update event i want 1 button click to be mandatory.
I have 2 buttons
So in the form before update event i want my user to click either one of the button before the record gets saved.
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
In my form one feild is there from diffrent table. So when my cursor reach to that feild it gives the message "Please click either Save or Cancel" which should not happen. Message should be shown only after filling all the feild.
Let's say the buttons are named cmdSave and cmdCancel. You could use the following code in the form module:
Private blnOK As Boolean
Private Sub cmdCancel_Click()
If Me.Dirty Then
Me.Undo
End If
End Sub
Private Sub cmdSave_Click()
blnOK = True
If Me.Dirty Then
Me.Dirty = False
End If
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
If blnOK = False Then
MsgBox "Please click either Save or Cancel", vbExclamation
Cancel = True
End If
End Sub
Private Sub Form_Dirty(Cancel As Integer)
blnOK = False
End Sub