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 
Query Showing Primary Key
Teri Bridges 
    
4 years ago
I have 2 tables each had a Status ID. Both status fields are set to number. When I run my query I am getting the primary key from my status table (Column 0) I would like my query to show the value (Column 1). Can anyone help? I do not mind that the primary key post in the second table. But My report, which I am basing on the query needs to show the value not the primary key ID. My form reflects the correct value in a drop down. but I cannot seem to figure out how to get the value right in my report.
Kevin Robertson  @Reply  
          
4 years ago
Have you added the Status table to the query?
Add the field from the table you want to display to the query.
Teri Bridges OP  @Reply  
    
4 years ago
Yes I added the status table, and I am using that combo box. if I make the change in the query I get the primary key. I am thinking it has something to do with bound columns. The form reflects the correct value but the report and the query reflect the primary key.

I am trying so hard not to go back and use lookups in my table. But this gets so complicated. Frustration to no end.LOL
Kevin Robertson  @Reply  
          
4 years ago
Can you post a screenshot of your query in design view?
Teri Bridges OP  @Reply  
    
4 years ago
Yes
Teri Bridges OP  @Reply  
    
4 years ago

Teri Bridges OP  @Reply  
    
4 years ago
I guess I could remove the auto number as the primary key and make the value my primary key. But somehow I do not think that would be the proper way to get the result.
Teri Bridges OP  @Reply  
    
4 years ago
I did try a dLookup in my query =DLookup("Status","StatusTBL","StatusID="&[Status]) but that creates a circular reference, what ever that means. So I removed that.
Kevin Robertson  @Reply  
          
4 years ago
This is what I meant by adding the Status table to the query (see screenshot).
Kevin Robertson  @Reply  
          
4 years ago

Teri Bridges OP  @Reply  
    
4 years ago
Kevin I ended up getting it to work but I did my Join a bit different. Am I wrong.
Teri Bridges OP  @Reply  
    
4 years ago

Kevin Robertson  @Reply  
          
4 years ago
No not necessarily, but be aware that if you have tasks where the status hasn't been set they won't show up in your query or report. If you do find you are missing tasks, the join type would be the first aspect to look at.
Teri Bridges OP  @Reply  
    
4 years ago
So what I think I am learning. do not use lookups in my table. Create other tables with the values. In doing this I need to make sure that the primary key of the reference table format is the same as the primary key. So for example my main table has Status and my Status table had the list of statuses auto numbered primary key. In order to create the join my main table status had to be formatted to number or I got the error mismatch. This mean that my main table populated with the Primary key numbers but the quries, forms and reports will show the values. Am I understanding that correct
Alex Hedley  @Reply  
           
4 years ago
StatusID would be Foreign Key in the main table,
Teri Bridges OP  @Reply  
    
4 years ago
Well that went to hell. Now when I make an entry it is changing my reference table value list to numbers. I have no Idea what I have done.
I Changed my join to match yours.
Teri Bridges OP  @Reply  
    
4 years ago

Teri Bridges OP  @Reply  
    
4 years ago
Just when I thought I was really learning something. BOOM NOT.
Teri Bridges OP  @Reply  
    
4 years ago
I don't even know how to google that issue. LOL
Teri Bridges OP  @Reply  
    
4 years ago

Teri Bridges OP  @Reply  
    
4 years ago

Kevin Robertson  @Reply  
          
4 years ago
A Select Query shouldn't be changing the data in the table like that. Are you still using lookups in your query as you first screenshot shows?
Kevin Robertson  @Reply  
          
4 years ago
Here is a video on Outer Joins.
Teri Bridges OP  @Reply  
    
4 years ago
Well, when I create the form I delete the status field and replace it with a combo box so the user can update the status as they progress.
When I create the query it is not a combo box, but it appears that the form changes that when I insert the combo box.

How would I make it so the user can select a status?
Teri Bridges OP  @Reply  
    
4 years ago
Ok I stand Corrected, when I change the form to a combo box it does not change the Query. My bad.
But it sure enough is changing the data in my statusTBL
Teri Bridges OP  @Reply  
    
4 years ago

Teri Bridges OP  @Reply  
    
4 years ago

Teri Bridges OP  @Reply  
    
4 years ago

Teri Bridges OP  @Reply  
    
4 years ago

Teri Bridges OP  @Reply  
    
4 years ago

Kevin Robertson  @Reply  
          
4 years ago
The value from your Combo Box is a number (StatusID), so the Control Source should be StatusID.
Teri Bridges OP  @Reply  
    
4 years ago
Then I am back to the query and the report showing the ID # as opposed to the value.
How would I get the form so the user can select the status? My frustration tells me to get rid of auto number! but I know that is wrong.
Richard made it look easy when he updated the form with the combo box!
Teri Bridges OP  @Reply  
    
4 years ago
So I watched the Relational Combo video several times and I thought I was doing what was taught in the video.
So where Richard was adding the titleTBL combo box I replaced that with my StatusTBL combo box.
Now I did notice that he did this to update the customer table and I was doing mine to update the query. Is that what I am doing wrong?
Should my form be based on the table and not a query?

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 6:45:34 AM. PLT: 0s