Automate Export Of Reports

jereece

Registered User.
Local time
Today, 16:15
Joined
Dec 11, 2001
Messages
300
I have several reports in my Access database and I have a LAN that I export these reports to so other groups at my site can have access to them.

My question: Is there a way to automate this process? Specifically is there a way to automatically on a daily frequency, export specific reports to Microsoft Word, then save them to a LAN (e.g. \\cnsfs\carb\reports\ or I:\reports)?

Thanks for the help.

Jim
 
re:

Hi,
set up a procedure which uses the OutputTo Method to output all the reports you want. Keep in mind that graphical things like lines or checkboxes might not be transfered correctly. There are some workarounds for these issues e.g. here and here or you might find this sample helpful, but normally it is advised to rather output to snapshot (snp) or pdf format to keep all graphical parts.
Ones you have your procedure setup you can use the RunCode action in a macro to call this procedure...also make sure that the last action of either the procedure or the macro itself is to shut down the application...then call this macro with the macro command line switch in a batch file using the windows scheduler or some other scheduling software. You can find more about this here!
HTH
Good luck
 
What we have done is use a macro scheduler program in which I open the specific database and run the macro to update reports. Within the macro there are various output steps that send reports to excel, word , snapshot type files on my lan and we use another datanbase set up as a front end to access the reports. This is the method we use. Good Luck
 
I am just getting back to work on this.

What I have done is to create a Macro within Access. It's commands are

1. Open Report in Print Preview
2. Run Command: Export To RTF
3. Save
4. Close

This works but my only problem is the default location for saving is "My Documents" It would be nice if I could specify a different location.

Also, since I will be exporting these reports several times a day, the file will already be in existance so Windows prompts me to acknowledge I want to replace the document. Is there a Run Command to "Enter" or "Click" so I can automate this?

Thanks for the help.

Jim
 
re:

Hi,
you will be much better of creating a custom public function for this...then call this function with the RunCode action in the macro.
You would want to look at the Outputto method for the exporting of the report...you can specify what path to use there in the 'outputfile' argument.
Before executing that use the Len() and Dir() functions to check if the file already exists and base your action on that.
Macros are very very limited and can not handle error handling (at least not yet). After you created and tested your function proceed as mentioned in the beginning by calling the macro which calls this function with a batch file and the macro command line switch from the scheduler.
HTH
Good luck
 

Users who are viewing this thread

Back
Top Bottom