compairing/retrieving info on a record

homeguard

Registered User.
Local time
Today, 03:52
Joined
Feb 14, 2007
Messages
35
I have a table of all the user logon IDs in it with the employee's name and infos.

Is there a way to select a record out of a table by the logon ID and assign the employee's name to a variable/field?

basicly i want to filter a table by the employee name after that.
 
Use DLookup.

This is an example:
Code:
Dim strEmployeeName As String
Dim strLoginID

strLoginID = Environ("currentuser")
strEmployeeName = DLookup("[EmployeeNameFieldHere]","YourTableNameHere","[LoginID]='" & strLoginID & "'"

You'll need to change the items to fit the actual names of the Fields and table. Also, if LoginID is the NT Login of the person you can use the Environ("username") to get it but if it isn't then you'll have to assign it to the variable in whatever way you are capturing it at login.
 

Users who are viewing this thread

Back
Top Bottom