DBTechServ
Technical User
Hi all.
I have an access 2010 database which makes use of multiple tables and all use the same structure. Each table is named based on an unique project alpha-numeric identifier and contains that specific project's bill of materials.
What I need is to be able to query multiple tables for a specific part id number and only list tables that contain that item.
Below is a working query that list a range of table names based on the hard coded values that I am testing with. I will eventually want to change that to variables that are entered at runtime -
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name)>"200100" And (MSysObjects.Name)<"200201") AND ((MSysObjects.Type)=1));
Below is a working query that list the all of the parts used in a specific project -
SELECT [200100 VPK-260].[ID NO], [200100 VPK-260].DESCRIPTION, [200100 VPK-260].[MFG NO]
FROM [200100 VPK-260]
WHERE ((([200100 VPK-260].[ID NO])="77101664"));
I am not a SQL programmer and any help would be appreciated.
I have an access 2010 database which makes use of multiple tables and all use the same structure. Each table is named based on an unique project alpha-numeric identifier and contains that specific project's bill of materials.
What I need is to be able to query multiple tables for a specific part id number and only list tables that contain that item.
Below is a working query that list a range of table names based on the hard coded values that I am testing with. I will eventually want to change that to variables that are entered at runtime -
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name)>"200100" And (MSysObjects.Name)<"200201") AND ((MSysObjects.Type)=1));
Below is a working query that list the all of the parts used in a specific project -
SELECT [200100 VPK-260].[ID NO], [200100 VPK-260].DESCRIPTION, [200100 VPK-260].[MFG NO]
FROM [200100 VPK-260]
WHERE ((([200100 VPK-260].[ID NO])="77101664"));
I am not a SQL programmer and any help would be appreciated.