MwTV
MIS
- Mar 9, 2007
- 99
Producing 4 reports per month by importing data into Excel (Using Microsoft Query) from tables within a Microsoft Access 2002 database. The tables within the MS Access database are created with make-table queries.
Each of the make-table queries require three or more parameters. For example, the August 2007 Roster
Report have the following parameters - "Begin_Date >= 8/01/07", "End_Date <= 8/31/07" and "Annual_Review_Dt >= 8/1/07."
The parameters for the September 2007 Roster Report will be
"Begin_Date >= 9/01/07", "End_Date <= 9/30/07" and "Annual_Review_Dt >= 9/1/07."
Questions/Comments:
1. Can I store parameters in an Access table and have the make-table queries "automatically" kick off
during the night and "pull" in the correct value for the parameter? This way, I would not have to
manually enter the parameters?
For example:
Month------Begin_Date--End_Date--Annual_Review_Dt
Jan--------1/01/07-----1/31/07---1/01/07--------
The other option is to create 48 queries (4 for each month in a year) and "hard-code" the dates and not
worry about entering parametes.
2. If I create the 48 queries, any insight as to how I would set up vba code to "conditionally run"
the queries depending on the month that the query was run? In other words, if a scheduler kicks off
during September 2007, then, the query titled "qrySeptember" should be run. If the scheduler kicks off during October 2007, then the query titled "qryOctober" should be run.
Is this doable?
Thanks in advance for any insight.
Each of the make-table queries require three or more parameters. For example, the August 2007 Roster
Report have the following parameters - "Begin_Date >= 8/01/07", "End_Date <= 8/31/07" and "Annual_Review_Dt >= 8/1/07."
The parameters for the September 2007 Roster Report will be
"Begin_Date >= 9/01/07", "End_Date <= 9/30/07" and "Annual_Review_Dt >= 9/1/07."
Questions/Comments:
1. Can I store parameters in an Access table and have the make-table queries "automatically" kick off
during the night and "pull" in the correct value for the parameter? This way, I would not have to
manually enter the parameters?
For example:
Month------Begin_Date--End_Date--Annual_Review_Dt
Jan--------1/01/07-----1/31/07---1/01/07--------
The other option is to create 48 queries (4 for each month in a year) and "hard-code" the dates and not
worry about entering parametes.
2. If I create the 48 queries, any insight as to how I would set up vba code to "conditionally run"
the queries depending on the month that the query was run? In other words, if a scheduler kicks off
during September 2007, then, the query titled "qrySeptember" should be run. If the scheduler kicks off during October 2007, then the query titled "qryOctober" should be run.
Is this doable?
Thanks in advance for any insight.