message box does not appear (1 Viewer)

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.
 

S

Registered User.
Local time
Today, 02:15
Joined
Feb 17, 2000
Messages
33
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

Top Bottom