Hi guys
I want to check if the current logging user exist in the tbluser or not. If it doesn't then message should appear that "The user doesn't exist in the database, Please raise request to your team leader to add you in". But if exist then it should check the "status" of the user in tbluser. If status is Admin then all buttons should become visible otherwise just few options should be visible.
But for now in the else section I have just put the message "exist". But this doesn't work. As it displays message "exist" even the current user is not present in the table.
Any help would be much appreciated.
Thanks
I want to check if the current logging user exist in the tbluser or not. If it doesn't then message should appear that "The user doesn't exist in the database, Please raise request to your team leader to add you in". But if exist then it should check the "status" of the user in tbluser. If status is Admin then all buttons should become visible otherwise just few options should be visible.
But for now in the else section I have just put the message "exist". But this doesn't work. As it displays message "exist" even the current user is not present in the table.
Code:
Private Sub Form_Load()
If DLookup("user", "tbluser", "User='" & Environ("username") & "'") = 0 Then
MsgBox "The user doesn't exist"
Else
MsgBox "exist"
End If
End Sub
Any help would be much appreciated.
Thanks