Getting the value for the next field (1 Viewer)

George Too

Registered User.
Local time
Today, 14:58
Joined
Aug 12, 2002
Messages
198
Hello all,

I was wondering how to do this:
A table has users and levels for the users. I have the following line of code:

Criteria = "[User] = '" & Environ("UserName") & "'"

This line searches for the username in the table just fine. The following field in the record is "level" which can be 1 or 2. How can I have Access find the user and do something based on the level for that user? In other words, find the user and find the value for the level field.

Thanks for your help.
GeorgeToo
 

Travis

Registered User.
Local time
Today, 11:58
Joined
Dec 17, 1999
Messages
1,332
For a single Field such as in your case you can use DLookUp to return the Level and populate a variable. From There you can use the varable to determine you settings.


For more then one I would use a recordset. This reduces the # of calls to the backend data.
 

George Too

Registered User.
Local time
Today, 14:58
Joined
Aug 12, 2002
Messages
198
Thank you, that was simple.
 

Users who are viewing this thread

Top Bottom