I would like all combo boxes to have require data before the following macro is run from a button:
I've the Table has it required and the form has a validation rule of IS NOT NULL, However it still allows to move on and and error message is not sent.
Code:
Private Sub Command128_Click()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Please Verify Work Stream and Process" ' Define message.
Style = vbYesNo + vbInformation + vbDefaultButton2 ' Define buttons.
Title = "Verify Data" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
DoCmd.RunMacro ("Save") ' Perform some action.
Else ' User chose No.
MyString = "No" ' Perform some action.
End If
End Sub
Comment