I tried searching but I can't put it into words to get the results I want...
I have many linked tables that I can link to but can't edit. Each table is duplicated for various locations and named as such.
Eg Product
tblProd_1
tblProd_2
tblProd_3
tblProd_4
the numbers are for 4 different locatgions, but the table structure is the same.
I don't do a lot of work with SQL, I ussually just build the queries in design, but it would be easier if I could use a variable to alter the SQL for the table I want to access. This is just a simple example of twhat the table might look like....
SELECT tblProd_1.ClientCode, tblProd_1.ProductCode, tblProd_1.Description1
FROM tblProd_1;
Could someone show me the VBA syntax for just opening the table, I plan to use an option group (for Variable) on a form to choose the various locations for the table to run. I am comfortable with VBA so once I see the syntax. You can Hard code the variable, I should be able to figure it out after that.
The object is not to have to create 4 queries for the same thing but only one in SQL and be able to alter the SQL to choose one of the 4.
hope it makes sense
Thanks
I have many linked tables that I can link to but can't edit. Each table is duplicated for various locations and named as such.
Eg Product
tblProd_1
tblProd_2
tblProd_3
tblProd_4
the numbers are for 4 different locatgions, but the table structure is the same.
I don't do a lot of work with SQL, I ussually just build the queries in design, but it would be easier if I could use a variable to alter the SQL for the table I want to access. This is just a simple example of twhat the table might look like....
SELECT tblProd_1.ClientCode, tblProd_1.ProductCode, tblProd_1.Description1
FROM tblProd_1;
Could someone show me the VBA syntax for just opening the table, I plan to use an option group (for Variable) on a form to choose the various locations for the table to run. I am comfortable with VBA so once I see the syntax. You can Hard code the variable, I should be able to figure it out after that.
The object is not to have to create 4 queries for the same thing but only one in SQL and be able to alter the SQL to choose one of the 4.
hope it makes sense
Thanks