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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacing [currentuser] with name from table

Status
Not open for further replies.

Richey

Technical User
Aug 29, 2000
121
GB
On my main-menu form, I have a hidden text box 'cuser' with control source = [currentuser] and at the top of the form, a text box with control source = "Welcome & " " & [cuser]"
However, the users are logging in with names such as rhughes and bwhite, so the text box says Welcome bwhite. I'd like it to say Welcome Brian.
I have set-up a table with field names login and name. I have put all the login names (such as bwhite) in the login field and equated that with a name in the name field, Brian in this case.
Any ideas much appreciated

Ta
R
 
try this as a control source:

="Welcome " & DLookup( "[name]", "
", "[login]=" & [CurrentUser] )
 
OK, is your main-menu form based on any sort of query? If not, and they usually aren't, then create a query that is based on the table with login names and first names. In the login name column, in the Criteria row type [CurrentUser]. Don't show that field, only show the Name field. Then base your cuser field on [Name]

This is a bit rough, but it should point you in the right direction.

Kathryn


 
="Welcome " & DLookup( "[name]", "
", "[login]='" & [CurrentUser] &"'" )

I forgot some quotes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top