arcticsponge
VB makes me crazy
- Local time
- Today, 19:30
- Joined
- Oct 20, 2009
- Messages
- 12
Hi All,
I am using Dlookup to allow for user access using the popular "advapi32.dll" referenced as "fOSUsername" however, when I perform the lookup using fOSUsername or even a hard-coded reference, Dlookup only returns values from the first row.
The code I am using is simple enough:
The table / query are identical and show as:
admin user
Administrator Arcticsponge
Tom Fred
The DLookup will find the first row users (Administrator / Arcticsponge) but none other
I am using Dlookup to allow for user access using the popular "advapi32.dll" referenced as "fOSUsername" however, when I perform the lookup using fOSUsername or even a hard-coded reference, Dlookup only returns values from the first row.
The code I am using is simple enough:
Code:
Private Sub Command74_Click()
Dim user As String
user = fOSUserName
If user = DLookup("user", "quser") Then
MsgBox "The lookup was successful", vbInformation
Else
MsgBox "Try again", vbExclamation
End If
End Sub
The table / query are identical and show as:
admin user
Administrator Arcticsponge
Tom Fred
The DLookup will find the first row users (Administrator / Arcticsponge) but none other