Hi Guys,
I have the following code which checks for non-Null fields prior to table update, so naturally, I have it on Before_Update of my form.
Now I want this validation to work ONLY WHEN a field named "docref" Is Null and "destname" is also Null. If "docref" Is Not Null, then the validation should not pop-up and allow the form to save with "destname" being Null or zero length. (offcourse the backend table allows for zero lenght for the "destname" field. I hope my question is clear. :-|
Any ideas please.
I have the following code which checks for non-Null fields prior to table update, so naturally, I have it on Before_Update of my form.
Code:
Dim strMessage As String
Dim intOptions As Integer
Dim strTitle As String
Dim bytChoice As Byte
If IsNull(destname) Then
strMessage = "You have not entered a Destination for this Record." & _
"Input a destination to continue" & vbCrLf & vbCrLf & _
"Click ok to return to form."
intOptions = vbOKOnly
strTitle = "Missing Data..."
bytChoice = MsgBox(strMessage, intOptions, strTitle)
'If bytChoice = vbOKOnly Then
'Set focus to the destname field destname.SetFocus
'highlight empty field
Dim Green As Long
Green = RGB(229, 238, 124)
destname.BackStyle = 1
destname.BackColor = Green
'Cancel saving the record
Cancel = True
'End If
End If
Any ideas please.
Comment