M
Mark
Hi,
I have a subform with a record source based on a query.
That query asks two things (Employee ID and NT Name). I
am trying to get the subform to not open if the query
returns no records. So, if the user enters something that
does not equal a record... a message box appears and the
subform is not opened. I tried the following, but it is
not working. How can I get this to work? Thanks!!!!
Private Sub Form_Open(Cancel As Integer)
If IsNull(DLookup_
("EmployeeID", "queryEmployeePassword")) Then
MsgBox "The Employee ID and NT Logon is not_
valid.", vbCritical, "Notice:"
ElseIf IsNull(DLookup_
("NTName", "queryEmployeePassword")) Then
MsgBox "The Employee ID and NT Logon is not_
valid.", vbCritical, "Notice:"
End If
End Sub
I have a subform with a record source based on a query.
That query asks two things (Employee ID and NT Name). I
am trying to get the subform to not open if the query
returns no records. So, if the user enters something that
does not equal a record... a message box appears and the
subform is not opened. I tried the following, but it is
not working. How can I get this to work? Thanks!!!!
Private Sub Form_Open(Cancel As Integer)
If IsNull(DLookup_
("EmployeeID", "queryEmployeePassword")) Then
MsgBox "The Employee ID and NT Logon is not_
valid.", vbCritical, "Notice:"
ElseIf IsNull(DLookup_
("NTName", "queryEmployeePassword")) Then
MsgBox "The Employee ID and NT Logon is not_
valid.", vbCritical, "Notice:"
End If
End Sub