message box does not appear

  • Thread starter Thread starter reischaa
  • Start date Start date
R

reischaa

Guest
I have written a macro for a control on a form to check the data entered and show a message box if the data is in violation of the conditions I specified. When the condition is violated, an access message box appears (a generic one for validation problems), but I can't seem to get it to show the message argument that I specified in the macro. Thanks for any suggestions.
 
System intercepts the error befor your macro starts; cancel the restriction on the table, then on AfterUpdate event of your control (called Dat) try this code
If Format(Dat, "dd/mm/yyyy") <> Dat Then
MsgBox "Date Format not correct, admin will correct your mistake"
dat = format(Dat, "dd/mm/yyyy")
End If
Hope this helps you, S.
 

Users who are viewing this thread

Back
Top Bottom