I have an Access 2003 report that I need to export, to separate files for separate recipients. Currently, I do this by having separate copies of the report saved with individual filters – e.g., [Recipient]=”name 1” – and running a macro using “Output To” to export each file separately. What I’d like to do (I think) is to have a single copy of the report with a filter like [Recipient]=[Name], and in a macro swap name1, name2, name3 etc. into [Name], so that it would read something like:
Set [Name] = “name1”;
Output report
Set [Name] = “name2”;
Output report
Etc.But I can’t find a way to change the value of [Name] from within a macro. Any ideas?
You could have a combobox or listbox with all the names populated into it, then when you select an entry, set the variable 'Name' to the text value of either the listbox or combodox then run output report Eg for combobox
Recipient = combobox1.text
output reportin this way you can control which report should be output by just selecting the appropriate value in the combobox, and only having to run the report once.
There is no need for multiple lines of code.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |