Dlookup...

J

Julia82

User = Text Box
Access = Field 3 from Table "UserT" (text)
UID = Field 1 = Autonumber (number)
Name = Field 2 from Table "UserT" (text)

I Want:

I want to lookup for the Access of the Name in the UserT Table.
I want to veryfi What access has the username in the same table by the id of
the name in the same table. Hope this makes sense.

I have two text boxes. When there is text in that textbox, I want the text
to be verifyed in the table UserT and to read from Access field and display
value.

I have:

Me.User.Value = DLookup("Access", "UserT", "UID= " &Name)

What do I do wrong? Thanks!
 
A

Al Campagna

Julia82,
First, get rid of the field name "Name" It's a reserved word in Access.
See "reserved words" in Access help.
Use something like CompanyName, or LastName, etc...
I'll use CompanyName for this post...

That might do it, but if not, please post back some with some
example values. "Here's what I have, and here's what I should get."
We'll need to know about the table fields and types involved, and where
you're getting the DLookup values.

Also...
Me.User.Value = DLookup("Access", "UserT", "UID= " & CompanyName)
It would also appear that you're incorrectly trying to equate an
autonumber
(Long Integer) with a CompanyName (Text)
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
J

Julia82

Ok, thanks for the tip.
Fixed that, changed the name and instead of the name I put & UID.

Still doesn't return a value. Gives me an error. "missing operator".
 
A

Al Campagna

Julia82,
Whenever you have a problem with code, always cut and paste
"exactly" the code you used... when you reply. We need to see that in
order to do any further problem determination.
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
J

Julia82

Thanks for the help and your time. Solved. Had to change the expression
because I had a text and was different.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top