473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DLookup problem

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
4 3749
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ronny Sigo | last post by:
Hello all, I already put the same question, only now I have more to tell ... Although I used this code before in the same routine (only the fieldname of the table differs) ___ at this point in the...
0
by: Tony Williams | last post by:
I have posted a number of posts in the Access newsgroups concerning my problem with DLookup. I have had a number of the experts with helpful suggestions but I still can't get it to work! This is...
2
by: ctyrrell | last post by:
I have read with interest the many discussions of the 3048 Error: Cannot open any more databases. I understand how the number of open Table ID's causes the problem. My question has to do with the...
8
by: Christine Henderson | last post by:
I have a problem using the above function in the following simplified circumstance: In the lookup table called "Klms Travelled" I have 3 fields, eg: Receiver Name Receiver Suburb ...
6
by: Don Sealer | last post by:
I've written this expression for a DLookup function. It works almost alright. What I'm trying to do is type in a description and the ID field (number) populates automatically. It works almost as...
11
by: MLH | last post by:
DLookup("", "tblPreliminaryVINs", "=Forms!frmVINODO!SerialNum") is giving me a Type Mismatch error. That's confusing to me and I don't know how to circumvent it. The field in...
2
by: chris.thompson13 | last post by:
I am having a problem setting the criteria part of the DLookup method correctly and am consequently getting an error message. I have a database of staff duties, part of which is a query (qryDaily)...
2
by: Don | last post by:
Can someone help me fix my DLookup problem. I'm far from proficiency with Access. I've been creating databases for several years for work with the help of many of you and trial and error. I have...
2
by: boyleyc | last post by:
Hi all the following code works perfectly well. Basically it populates a series of check boxes on my form, depending on whether dlookup finds an associated record. The problem i have is that...
15
by: rleepac | last post by:
This is a little complicated but I'll do my best to explain. In my db I have a table called L_AgeCorrection which has the following fields: Age, Sex, Frequency, AgeValue This is a table used to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.