dlookup user from another table based on text from another filed (1 Viewer)

murray83

Games Collector
Local time
Today, 12:13
Joined
Mar 31, 2017
Messages
728
hope this is a quick and easy one

this is my code

Code:
=DLookUp("[colleague]","[userlogins]","[login] = ' [txtID] ")

i have a table with the proper names which are associated with the environment name

and am trying to get it to look up and populate an unbound text box all my code does is put error

please help

ta
 

murray83

Games Collector
Local time
Today, 12:13
Joined
Mar 31, 2017
Messages
728
does it matter that my enviro name is CCCNNN.CNNN

and have noticed on my table it has no dot
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 07:13
Joined
Apr 27, 2015
Messages
6,321
Try this

=DLookUp("[colleague]","[userlogins]","[login] = '" & [txtID] & "'")

If it works, I will tell you why!
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 07:13
Joined
Apr 27, 2015
Messages
6,321
Sorry Paul, didn't know you were engaged, up kinda early are we?
 

murray83

Games Collector
Local time
Today, 12:13
Joined
Mar 31, 2017
Messages
728
it works but don't display the name

ill have another crack on monday

cheers though
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 07:13
Joined
Apr 27, 2015
Messages
6,321
A necessary evil associated with "wedding bliss". Such is life...
 

murray83

Games Collector
Local time
Today, 12:13
Joined
Mar 31, 2017
Messages
728
Try this

=DLookUp("[colleague]","[userlogins]","[login] = '" & [txtID] & "'")

If it works, I will tell you why!

and what if it half works as i no longer have #error or #name

just a blank txtbox ???
 

missinglinq

AWF VIP
Local time
Today, 07:13
Joined
Jun 20, 2003
Messages
6,423
If login is defined as a Number Datatype, the correct syntax would be

=DLookUp("[colleague]","[userlogins]","[login] = " & [txtID])

Linq ;0)>
 

murray83

Games Collector
Local time
Today, 12:13
Joined
Mar 31, 2017
Messages
728
no its set to text as the login for the pc follows this fomat

TTT111.T111
 

murray83

Games Collector
Local time
Today, 12:13
Joined
Mar 31, 2017
Messages
728
its all ok i fixed by doing the following

adding another unbound text box which got the enviro name

cheers all for help
 

missinglinq

AWF VIP
Local time
Today, 07:13
Joined
Jun 20, 2003
Messages
6,423
The NauticalGent's syntax is correct!

Glad you got it fixed!

Linq ;0)>
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 07:13
Joined
Apr 27, 2015
Messages
6,321
I have been on travel in the remotest area of South Carolina. I see you got it figured out, well done!
 

PKRipper

New member
Local time
Today, 06:13
Joined
Dec 31, 2020
Messages
1
NauticalGent, I know you posted this awhile ago but I have been trying for a day and a half to get the DLookup to work. I probably went to 40 or 50 different websites and nothing worked until I plugged in the code you posted above and wallah! Nobody can appreciate the elation one feels when they select a dropdown and the corresponding field prefills with the desired information unless they actually enjoy doing this stuff for a living.

So thank you sir and hope you have a great new year!
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 07:13
Joined
Apr 27, 2015
Messages
6,321
NauticalGent, I know you posted this awhile ago but I have been trying for a day and a half to get the DLookup to work. I probably went to 40 or 50 different websites and nothing worked until I plugged in the code you posted above and wallah! Nobody can appreciate the elation one feels when they select a dropdown and the corresponding field prefills with the desired information unless they actually enjoy doing this stuff for a living.

So thank you sir and hope you have a great new year!
You are quite welcome and make 2021 a great One!

All the best to you and yours...
 

Users who are viewing this thread

Top Bottom