G
Guest
Hi all,
Here is what I try to do:
I have three fields in a form, 2 of them are text boxes and the third is a
ComboBox. I was trying to write a code that kicks in on form close that
checks if any of these 3 fields is blank, then pops-up a msg box in this
case. I know there is something wrong with my code. Can someone please help.
The code I wrote is the following:-
Dim msg As Integer
Dim StrMessage As String
Dim StrTittle As String
StrMessage = "You haven't entered a required field. This is not a
recommended practice. Please enter all required fields"
StrTittle = "Required Field Missing"
If Me.TenantName Is Null or Me.From_Date Is Null Or Me.End_Date Is Null Then
msg = MsgBox(StrMessage, vbOKOnly, StrTittle)
DoCmd.Close
Else
DoCmd.Close
End If
Here is what I try to do:
I have three fields in a form, 2 of them are text boxes and the third is a
ComboBox. I was trying to write a code that kicks in on form close that
checks if any of these 3 fields is blank, then pops-up a msg box in this
case. I know there is something wrong with my code. Can someone please help.
The code I wrote is the following:-
Dim msg As Integer
Dim StrMessage As String
Dim StrTittle As String
StrMessage = "You haven't entered a required field. This is not a
recommended practice. Please enter all required fields"
StrTittle = "Required Field Missing"
If Me.TenantName Is Null or Me.From_Date Is Null Or Me.End_Date Is Null Then
msg = MsgBox(StrMessage, vbOKOnly, StrTittle)
DoCmd.Close
Else
DoCmd.Close
End If