carpetbelly
Technical User
I keep getting a Run-Time error '424' on the following bit of code. Weird thing is I am positive I had it working pre xmas. I guess I didn't and I'm just still drunk from xmas lol
I get the error on the first DLookup line btw. I've run out of ideas.
Code:
Private Sub Form_Load()
Dim adminWin As String
Dim adminTab As String
Dim Str As String
adminWin = Environ("username")
If DLookup("[UserName]", "qryAdmin", "[UserName] = '" & adminWin & "'") Is Null Then
Str = "NA"
Else
Str = DLookup("[UserName]", "qryAdmin", "[UserName] = '" & adminWin & "'")
End If
adminTab = Str
If adminWin = adminTab Then
lblAdmin.Visible = True
cmdAdmin.Visible = True
Else
lblAdmin.Visible = False
cmdAdmin.Visible = False
End If
End Sub
I get the error on the first DLookup line btw. I've run out of ideas.