By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 991 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

DLookup problem

P: n/a
I have a table "Customer" with two fields "CusID" (autonumber, PK) and
"CusName" (text).
If I know the customer's ID, say 215, how can I find the name using DLookup?

PS:
I'm not really looking for an answer, I merely wish to be the one millionth
person to ask this question in the Access newsgroups before even glancing in
the help file.

Thanks in advance
Mar 28 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
OK so I'll be the millionth sucker who replies!

If you have a field on your form called CustomerID that is an integer
then use

Result = DLookUp("CusName","Customer","CusID = " & Me.CustomerID)

If the field contains a string use

Result = DLookUp("CusName","Customer","CusID = '" & Me.CustomerID &
"'")

Geoff
Karen Bielska wrote:
I have a table "Customer" with two fields "CusID" (autonumber, PK) and
"CusName" (text).
If I know the customer's ID, say 215, how can I find the name using DLookup?

PS:
I'm not really looking for an answer, I merely wish to be the one millionth
person to ask this question in the Access newsgroups before even glancing in
the help file.

Thanks in advance


Mar 28 '06 #2

P: n/a
Thank you, Geoff.
Perhaps you can also tell me:
How do I reset my autonumber to 1?
How can I have more than 255 fields in my table?
Can I turn my mdb into an exe?
Why are people so generous with their time when others ask such stupid or
lazy questions?

"Geoff G" <ge***@sunny-side.ws> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
OK so I'll be the millionth sucker who replies!

If you have a field on your form called CustomerID that is an integer
then use

Result = DLookUp("CusName","Customer","CusID = " & Me.CustomerID)

If the field contains a string use

Result = DLookUp("CusName","Customer","CusID = '" & Me.CustomerID &
"'")

Geoff
Karen Bielska wrote:
I have a table "Customer" with two fields "CusID" (autonumber, PK) and
"CusName" (text).
If I know the customer's ID, say 215, how can I find the name using
DLookup?

PS:
I'm not really looking for an answer, I merely wish to be the one
millionth
person to ask this question in the Access newsgroups before even glancing
in
the help file.

Thanks in advance

Mar 28 '06 #3

P: n/a
Hi,
1) For reset the autonumber to 1 you can create same table in other
name then copy the data to the new table then delete the existing table
and change the name of the new table to the last. there's another
option but it's too complicated
2) Why do you need more then 255 fields in table??
3) You can turn you'r mdb to mde it's similar to exe, Choose Tools -->
Database Utilities --> Make MDE File
4) We all have sometime a stupid question:)))

Regards, Haim Rubin.

Mar 28 '06 #4

P: n/a
Karen Bielska wrote:
I have a table "Customer" with two fields "CusID" (autonumber, PK) and
"CusName" (text).
If I know the customer's ID, say 215, how can I find the name using DLookup?

PS:
I'm not really looking for an answer, I merely wish to be the one millionth
person to ask this question in the Access newsgroups before even glancing in
the help file.

Thanks in advance


LOL!

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
Mar 28 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.