Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Key Instead of Name
Daniel Schuster 
     
4 years ago
I'm getting key numbers in my reports instead of people's names. I know that's the way it's supposed to work, but I'm sure there's a way to tell the report to show the data instead of the key number.
Daniel Schuster OP  @Reply  
     
4 years ago

Adam Schwanz  @Reply  
           
4 years ago
Easiest way is to use a query as the record source, bring in the related table into the query that shows the actual data.
Peter van Soest  @Reply  
    
4 years ago
dlookup is a perfect way to handle this. No extra queries or fields necessary.

just put a textbox on your report with a code like:

DLookUp("Customername";"CustomerT";"CustomerID= " & "CustomerID")
Richard Rost  @Reply  
          
4 years ago
Both suggestions are good. I'd personally use Dlookup for a SINGLE form. I avoid them on continuous forms as they will slow things down. That's when a query is better.
Daniel Schuster OP  @Reply  
     
4 years ago
Thank you all for your attention.
Daniel Schuster OP  @Reply  
     
4 years ago
I've watched the DLOOKUP video about 4 times now and I'm making progress. However, things are getting weird. the DLookup field just says #Error.

I just realized that only values that are being pulled from Queries (by relational combo boxes) are coming out as numbers. The relational combo boxes that I am using to pull from Tables are showing the correct information. That's interesting.

So, one question is, in the DLOOKUP code, do I ask to pull from the T or the Q?

Then, for the DLOOKUP 'criteria' portion, I am using the 'CustomerID=' (which is pulling from CustomerT ((or Q?)) & CustomerCombo [[which is the name of the field that is circled in the image above. Or, should I have it reference the combo box from the FORM that this report is pulling from?]]

This stuff is really cool and complicated. I'm working on graphing it out now so I can explain my situation better. Your support is amazing. Thank you!!!!!!
Scott Axton  @Reply  
        
4 years ago
Daniel your if your ID is not found in the look up it will throw and error.
Check out the NZ Function video
Daniel Schuster OP  @Reply  
     
4 years ago
Thanks Scott. There are values in the field, I just think I'm building the DLOOKUP wrong. I'm using =DLOOKUP("LastName", "CustomerT", "CustomerID=" & CustomerCombo). It's not pulling the data in for some reason. Queries vs. Tables - why are the fields that are pulling from Tables having no problems, but the Query sources are only pulling in numbers? Also, does using DLOOKUP in a report instead of a form have anything to do with it?
Daniel Schuster OP  @Reply  
     
4 years ago

Daniel Schuster OP  @Reply  
     
4 years ago

Daniel Schuster OP  @Reply  
     
4 years ago

Daniel Schuster OP  @Reply  
     
4 years ago

Daniel Schuster OP  @Reply  
     
4 years ago
Sorry for all the pictures. I'm trying to do the Query work around but I can't figure out how it works. Please point me to the classes or videos that explain this because I realize this must be a very basic problem. In the first picture I get my Personnel and their instrument, but since the instrument is a foreign key from the InstrumentT, it just comes in as a number (because that's what it is). The next two pictures are me swapping out the foreign key of the PersonnelT for the actual instrument name from the InstrumentT. When I do that, it goes crazy as you see in the 4th picture. Each person only plays one instrument. How do I make the Query reflect that?
Kevin Robertson  @Reply  
          
4 years ago
In a post above you state you are using:
=DLOOKUP("LastName", "CustomerT", "CustomerID=" & CustomerCombo)

but in your images you are using different names (InstrumentQ and PersonnelID).

Try using this instead, making sure the Table/Query name is correct and also the Field name.
=Nz(DLOOKUP("LastName", "InstrumentQ", "PersonnelID=" & ComboBoxName), "")

Replace ComboBoxName with the name of your Combo Box.
Daniel Schuster OP  @Reply  
     
4 years ago
I was trying to simplify the explanation. I am using my tables, queries, etc. in my DLOOKUP fields. What you're saying is that there shouldn't be any difference between using a Query or a Table and it shouldn't matter if it's being used in a Form or a Report?

I'm using a work around where I'm inserting the DLOOKUP field in my Form instead of Report, because it's working there for some reason.
Adam Schwanz  @Reply  
           
4 years ago
For the query you need to make a relationship otherwise it will just create an entry for every instrument for every personell.

This would be the foreign key in PersonellT going to the primary key in InstrumentsT

InstrumentID to InstrumentID, I don't know if you have an instrumentID though, I see you have an instrument field in personellT, is that a number field for the relationship or is that a short text field?
Daniel Schuster OP  @Reply  
     
4 years ago
I had created relationships at the database level, but not at the Query level. Didn't know that was a thing. Hopefully I didn't just miss it in the beginner series....

Thanks so much!!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/30/2026 3:21:51 AM. PLT: 0s