New to Access, have a table question

  • Thread starter Thread starter pgarcia
  • Start date Start date
P

pgarcia

I then have to change 6 quires to a new table each quarter. Is there a VB
code that will insert the new table into the quires and then change the table
field to that new table? The file name is different each time, so I would
need to have the VB code ask me for the new table name and run the VB code.
The file name are like so: USRM20080414, USRM20080714, etc.

Thanks
 
You can, but you should not.
What is the point of chaning tables each quarter?
The correct method is to have one table with a date field. If you need to
retrieve data for a specific quater, use a query that filters on the date:
WHERE DatePart("q", DateField) =

To modify the table names in a stored query, you read the SQL property of
the query using a querydef object into a string variable. You can then
modify the variable to replace the old table name with the new, then update
the SQL property with the string variable.
 
Back
Top