How do I handle nonexistent records with DLookUp? I want to verify that someone is an authorized user before the database opens. My code is:
“Administrator” is a True/False field. “fOSUserName()” is a function that returns the system logged on user name.
Tom
MCSD
I Nab Terrorists
Code:
Private Sub Authenticator()
If (DlookUp(“[Administrator]”, “[tblUsers]”, “[UserID] = “ & “fOSUserName()”)) = (-1) then
Open a form
Exit Sub
End If
Open the “Get Lost” form
End Sub
“Administrator” is a True/False field. “fOSUserName()” is a function that returns the system logged on user name.
Tom
MCSD
I Nab Terrorists