Retrive form and subform names

D_R_Wood

New member
Local time
Today, 02:50
Joined
Jan 23, 2014
Messages
4
I have not used Access since 2003, and I didn't use it very much. A friend asked me to fix a problem in an Access 2010 database. He created a series of tabs with subforms on each tab. The first tab contains the main profile of a customer. The other tabs contain detail information about customer orders, services, etc. Each subform has its own table and all of the tables have a Customer ID field. The problem is, he wants to select a customer on the primary customer profile tab and when he clicks another tab he wants it to display the data on the tab for the same customer as was selected on the primary customer profile. If the customer ID id 345 on the profile and he clicks the Orders tab, he wants to see the orders for customer 345. I created queries to select the customer ID fro each subform on the tabs and intend to use the Customer ID field on the profile to select the correct customer., but I do not know the names of the forms and subforms and he does not remember. I intend to use the subform names to create the criteria reference in the query. How can I find the names of the forms and subforms using something like properties.
 
Last edited:
My recommendation is that in the record sources of the sub forms, put a criteria on the customerid that takes the value of the box containing the customerid on your primary form.

So in the criteria box you'll have something like:
Forms![NameofYourForm]![NameofControlHoldingCustomerId]

You'll need to requery those sub forms after the update of the main CustomerID box so the forms automatically change when the user changes that ID.

Hope this helps!
 

Users who are viewing this thread

Back
Top Bottom