If code works initially

D

deb

I am trying to setup some validations.
I have put the below code in OnCurrent, BeforeUpdate Form, BeforeUpdate TLNo
Field.
It works initially but if user clicks responses and then clicks into other
fields on the above or below form, the validation is never triggered again.

How can I make the validation sitck until user makes appropriate changes?


Dim msg As String
Dim ans As String
If (Not IsNull(Me.f001WithinS.Form.WSDateReceive)) And (Me.TLNo = "TBD") Then
msg = "TL Number cannot be ""TBD"" if Received date is assigned." _
& vbCr & vbCr & "Select OK to remove Received Date."
ans = MsgBox(msg, vbOKCancel)
If ans = vbCancel Then
MsgBox "Please, enter correct TL Number."
Exit Sub
Else
If Me.NewRecord Then
Me.Undo
End If
MsgBox "The Received Date will be removed."
Me.f001WithinS.Form.WSDateReceive = Null
End If
End If
 
D

deb

I need to mention that there are forms, subforms and sub-subforms.
The data that needs comparisons in the validation are on 2 seperate forms.
see code...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top