Saving

Lyndseyd

Registered User.
Local time
Today, 00:22
Joined
Jul 6, 2005
Messages
71
Hi all,
when the users are saving the form, i want to make sure they have filled in certain fields. On previous forms my code has worked, but for some reason on this form it won't, i usually put:


If tankID = "" Then
MsgBox ("Please Enter the Tank ID")
tankID.SetFocus
End If

Can anyone explain why it may not be working, thank you
 
If you enter this code in the BeforeUpdate event you will need to do something like:

If IsNull(Me!tankID) Then
MsgBox("Error!")
Cancel = True ' This makes sure the form is not saved.
Me!tankID.SetFocus
End If
 
:) thats great, thank you for your help
 

Users who are viewing this thread

Back
Top Bottom