custom error msg for blank field

looneytunes

Registered User.
Local time
Tomorrow, 03:43
Joined
Feb 9, 2005
Messages
31
this may be simple - and yes, i have tried searching for the soln, but to no avail.
here goes:

i need a method whereby i can prompt the user with a friendly message when they have missed out a field. e.g. when typing in customer details, i need prompt the user to enter a forename if it is left blank. i have tried:
If IsNull(Forename) Then
MsgBox "Please enter a Forename"
End If
but dont know where to put it.
any advise would be grately appreciated as ever. thanks :)
 
Couple ways to do this, if you want to catch these one at a time, you can use the On Lost Focus event of each field, but the down side is you can get caught in a loop if you move between two of these fields and they both pop up a msgbox.
You can use the before update event and do the same thing, but you have to check them one at time for the single event, then cancel the event if you need to.
You can set fields as required on the table itself. This way the Db will enforce the required issue. But if you do, it WILL be required always.
Might even be another way or two.
 
thanks, i used lostfocus and it works well
 

Users who are viewing this thread

Back
Top Bottom