I am trying to use the DLookup function to check a table to see if a user exist in there; if not refuse them access. The following is the code I am using but it seems to just pop up the "Error Message" without really referencing the table
text33 = Environ("userna me")
Text69 = DLookup("[Forename]&' '&[Surname]", "Users", "[Username] = text33")
If text33 <> DLookup("[Username]", "Users", "[Username] <> text33") Then
MsgBox "You Are Not Authorized To Use This Form"
Else
If Val(Me.estp) > DLookup("amount authorized", "Users", "UserName = '" & Me.text33 & "'") Then
MsgBox "Amount Over approval limit, Please Assign to Your Manager"
Else
With MailOutLook
Any help will be appreciated
text33 = Environ("userna me")
Text69 = DLookup("[Forename]&' '&[Surname]", "Users", "[Username] = text33")
If text33 <> DLookup("[Username]", "Users", "[Username] <> text33") Then
MsgBox "You Are Not Authorized To Use This Form"
Else
If Val(Me.estp) > DLookup("amount authorized", "Users", "UserName = '" & Me.text33 & "'") Then
MsgBox "Amount Over approval limit, Please Assign to Your Manager"
Else
With MailOutLook
Any help will be appreciated
Comment