Trevor
04-09-2008, 11:45 AM
my DLookup is supose to lookup the username from the IndividualSettingsTbl based on the computer account username then msg the user Name but I keep getting wrong # of args error and Dlookup is highlighted. The table has no evtries so I should get the "N/A" msgbox.
Dim UsrName As String
Dim AccountName As String
AccountName = Environ("UserName")
UsrName = Nz(DLookup("UserName", "IndividualSettingsTbl", "UserName = '", AccountName), "N/A")
If UsrName = "N/A" Then
MsgBox UsrName
End If
End Sub
Thanks for helping
Dim UsrName As String
Dim AccountName As String
AccountName = Environ("UserName")
UsrName = Nz(DLookup("UserName", "IndividualSettingsTbl", "UserName = '", AccountName), "N/A")
If UsrName = "N/A" Then
MsgBox UsrName
End If
End Sub
Thanks for helping