Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Expert 3    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Customer Id on Form
Tom Iversen 
    
40 days ago
In Expert 3, Level 2 you (Richard) @ ~15:55 said that "we need the Customer ID on this form" in order to add a Command Button to open the Customer Form. You further said that it could be made invisible, which you did via the Property Sheet format.  Why does the Customer ID actually need to be placed on the Form?  I mean, it's just a Form.  Is not the ID being in the Query/Table control source enough?
Lisa Snider  @Reply  
       
40 days ago
In order for Access to know WHICH customer you wish to view when you press the command button, it needs to know WHICH customer is active on the record you are viewing. Placing the customerID field on your open form identifies the customer.
Kevin Robertson  @Reply  
          
40 days ago
In older versions of Access, you were required to have the ID on the Form.
In modern versions, this isn't always the case.
Alex Lewis  @Reply  
       
40 days ago
The ID was usually put on the form if you were referring to the ID from somewhere else, like a query or VBA code. Like Kevin says, it’s usually on a case by case basis.
Richard Rost  @Reply  
          
20 days ago
Lisa and Alex are on the right track: the button needs the CustomerID value for the current record so it knows which Customer Form to open. But Kevin is also correct that the ID does not necessarily have to be displayed, or even have a control on the form.

The important distinction is between a field in the form's Record Source and a control on the form. If CustomerID is in the form's Record Source, the form's current record has that value whether or not you put a textbox on the form. In VBA, I would normally refer to it explicitly like this:

Me.Recordset!CustomerID

Then use that value to build the WhereCondition for DoCmd.OpenForm.

However, if you want to refer to it externally with something like Forms!CallbackF!CustomerID, that generally refers to a control named CustomerID, so you would need a textbox control on the form - it can be hidden.

Deleting a control does not permanently leave a CustomerID property behind on the form. Access can resolve field names from the form's Record Source in some contexts, which makes this behavior seem a little magical, but it is not a substitute for a control when you specifically need to reference the control from elsewhere.

This is a good question, and I have been planning to cover the field-versus-control distinction in an upcoming Quick Queries video, or perhaps give it a full lesson.
Add a Reply Upload an Image
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: 8/13/2026 8:45:49 PM. PLT: 1s