Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select User ID from tbl based on users' Network Name 1

Status
Not open for further replies.

RCPD700

MIS
Jun 20, 2001
75
0
0
US
I have a form we intend to use for entering time worked for tasks with a detailed description of the work. I'm working with Access 2000.

In this mbd I have a table with all the team members in it along with initials, name, network name.

What I want to do is to fill in the user's initials field automatically by looking up their entry in the team members table using their network name. This way they only have to enter the project id, hours worked and description.

I have been successful (big thanks to this forum) in obtaining the network name (which I saved in a text box), but any select I've tried has failed. I keep getting prompted to supply variable info for the field I want to automatically fill in.

I have defined the field as a text box and as a list box without success. Should I use another control type?
Would another approach be better?

I love Access but don't get to work with it all that much since I'm primarily a mainframe guy. Any suggestions would be welcome.

Thanks in advance,

Jim
 
A starting point:
Me!txtUserInitials = DLookUp("UserInitials", "tblTeamMembers", "[Network Name][tt]='" & Environ("UserName") & "'")[/tt]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks very much for the starting point. I had to mess around with it a bit, but finally got it working with [blue]
=DLookUp("[User_ID]","CJIS_Team_Members","[User_LAN_ID]='" & udfGetNetWorkUserName() & "'")[/blue] as the default value setting for my User ID field.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top