Question DLookup Function not working

josephbupe

Registered User.
Local time
Tomorrow, 01:01
Joined
Jan 31, 2008
Messages
247
Hi,

I am attempting to capture accesslevel value into a txtAccesslevel on a login form when the user updates the cboUserName combo box. Hence, in the afterupdate even of the user combo box i have the following dlookup function:

Code:
Me.txtAccessLevel = DLookup("userAccessLevel", "tblUsers", "userName='" & Me.cboUserName & "'")
The table structure is as follows: -

tblUsers
userID = Auto
userAccessLevel = number
userName = text

However, when i update the cboUserName nothing happens in the txtAccessLevel.

Just wondering if am missing something.

I will appreciate your observations.

josephbupe
 
Hi josephbupe.. ;)

User name, the combo box may not be the first column of


Code:
dim UserTrz as string
me.cboUserName.column(1) 'which is the column
 
Me.txtAccessLevel = DLookup("userAccessLevel", "tblUsers", "userName='" & UserTrz & "'")
 
Hi Taruz,

I put your code in the afterupdate event of the combobox but got error

"Invalid use of the property" .Column
 

Users who are viewing this thread

Back
Top Bottom