I have a super simple Access DB with four tables and one form.. I'm an old hand at Excel VBA but am just starting with Access, so this is likely a totally stupid question, but here goes anyway.
In Form_Load() for the form, I have a time based trigger that lets the DB execute a macro and automatically quit when the macro is completed so I can run overnight maintenance where it runs some SQL queries on external databases, and builds an Excel workbook and a Word document based on the query.
It (form_load()) opens a recordset, and works with the recordset.
However, the macros that generate the Excel and Word files actually work with the FORM itself.
Here's the problem -- when my user manually runs the macros via commandbuttons on the form, they work great; it pulls the data from the selected record, generates the files, and they giggle and clap.
When I schedule a task to execute it via form_load(), however, it opens the recordset, scans through it, and then it runs the macros.. but the macros don't select any item on the form, so it always generates data for record 1 or 0 or...whatever.
How do I tell form_load() to actually go through the motions of selecting the form record as it processes the recordset fields so it's pointed at the right data?
In Form_Load() for the form, I have a time based trigger that lets the DB execute a macro and automatically quit when the macro is completed so I can run overnight maintenance where it runs some SQL queries on external databases, and builds an Excel workbook and a Word document based on the query.
It (form_load()) opens a recordset, and works with the recordset.
However, the macros that generate the Excel and Word files actually work with the FORM itself.
Here's the problem -- when my user manually runs the macros via commandbuttons on the form, they work great; it pulls the data from the selected record, generates the files, and they giggle and clap.
When I schedule a task to execute it via form_load(), however, it opens the recordset, scans through it, and then it runs the macros.. but the macros don't select any item on the form, so it always generates data for record 1 or 0 or...whatever.
How do I tell form_load() to actually go through the motions of selecting the form record as it processes the recordset fields so it's pointed at the right data?
Comment