All,
I have an if statement using various controls that are found on my form.
For example, I have three fields:
Date, Call Ref, Logged by.
I have button that checks those fields to see if they have been filled out or not, using the following code:
Now this does work in theory, though say if I was to enter information into the Call Ref field, click upon the CheckForm button, it would prompt me to fill out the other two controls (Date and Logged By).
The issue starts whenever I remove the text I have just placed in the Call Ref field. It doesn't prompt me to enter anything in the Call Ref field when pressing on the Check Form button.
Originally I tried:
Which did not work.
Is there a way that I can get around this?
Best regards
I have an if statement using various controls that are found on my form.
For example, I have three fields:
Date, Call Ref, Logged by.
I have button that checks those fields to see if they have been filled out or not, using the following code:
Code:
If IsNull(Me.Date) Then
lresponse = MsgBox("Please insert today's date", vbOKOnly, "Warning!")
Me.Date.SetFocus
ElseIf IsNull(Me.Call_Ref) Then
lresponse = MsgBox("Please insert a call reference number.", vbOKOnly, "Warning!")
Me.Call_Ref.SetFocus
ElseIf IsNull(Me.Logged_by) Then
lresponse = MsgBox("Please select the person who logged this call.", vbOKOnly, "Warning!")
Me.Logged_by.SetFocus
Else
lresponse = MsgBox("The Form has been successfully checked. No errors have been found. Please now press the 'Save Record' button to log this call and then press 'New Record' if you have another call to log. Otherwise please exit.", vbOKOnly, "Information!")
Me.SaveRecord.Enabled = True
End if
Now this does work in theory, though say if I was to enter information into the Call Ref field, click upon the CheckForm button, it would prompt me to fill out the other two controls (Date and Logged By).
The issue starts whenever I remove the text I have just placed in the Call Ref field. It doesn't prompt me to enter anything in the Call Ref field when pressing on the Check Form button.
Originally I tried:
Code:
If Me.Date= "" then
lresponse . . . .
Which did not work.
Is there a way that I can get around this?
Best regards