Add code in the On Current event procedure for the form to test the value of the control in question. If it's not null then display a message, cancel the event, and take the user to the control that must be filled in.
Private Sub Form_Current()
If Not IsNull(Me.Control1) Then
If IsNull(Me.Control2) Then
MsgBox "You must enter a value for Lot #", vbInformation
DoCmd.CancelEvent
DoCmd.GoToControl "Control2"
Exit Sub
End If
End If
End Sub
I would place any "validation Code" in an event triggered by the EXIT from the form (e.g. BEFOREUPDATE). This allows the user to do what they want without annoying 'Stuffffff'. If they are familiar with the requirements, they will fill in the correct (e.g. necessary) fields. If they FAIL to do it properly, you can alert them to any/all probelms (and usually suggest crrections?) at one time.
MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.