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
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