473,549 Members | 2,642 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3770
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("CusNam e","Customer"," CusID = " & Me.CustomerID)

If the field contains a string use

Result = DLookUp("CusNam e","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.goo glegroups.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("CusNam e","Customer"," CusID = " & Me.CustomerID)

If the field contains a string use

Result = DLookUp("CusNam e","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
14928
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 code I get the error "You canceled the previous operation" err msg. When clicking on Help I get a white screen. I haven't got the slightest idea...
0
1626
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 what I am trying to do: I have a table called tblmaintabs which holds year to date data for a number of companies which they supply on a quarterly...
2
4135
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 usage of the Elookup routine as a substitute for Dlookup. I read that Dlookup 'does not clean up after itself'. Most of the discussion centered...
8
4309
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 Klms Distance Jones Melbourne 500 Harrison Sydney ...
6
508
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 I've said. It doesn't populate until I go to a new record. Then if I go back to the record the number is in the field. Instead of populating...
11
2205
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 tblPreliminaryVINs is a 17-char text field. Forms!frmVINODO!SerialNum is just an unbound textbox on a form (frmVINODO). I run the DLookup during the textbox's...
2
2331
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) that returns all staffs duties for a selected day.e.g. Fullname Duty Name1 E1 Name2 ...
2
2269
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 used DLookup several times and I've actually re-created the same lookup just in different forms. Here's my problem. I'm using dlookup when I enter...
2
2342
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 when the date (or xDate) goes over to the next month, dlookup returns NULL even though though there is a record. For example if CALWEEKSTART is...
15
3096
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 assign an Age Correction value to hearing test results - since some degree of hearing loss naturally occurs with aging - OSHA lets us calculate that in...
0
7532
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7462
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7975
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7492
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6059
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1957
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1069
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.