Using variables in 2007 macros

Petermu

New member
Local time
Today, 20:34
Joined
Sep 9, 2008
Messages
3
Happy New Year to all!
I am using the OutputTo action in a macro to create mutiple copies of a report as an rtf file. I want each filename to have a common prefix (eg Customers copy) followed by a number (eg customers copy 1, customers copy 2 etc). i have tried concatenating the value of a tempvar variable to the file name but the macro fails each time. The variable contains the value of a for...next loop which controls the number of outputs.
The error message is "can't save the output to the file you've selected".

Any help would be much appreciated.
Peter
 
Hello Peter,

variables in a macro are difficult. I would recommend that you convert the macro to a module (supported by Access via Save As ... command) and solve your problem in VBA.

HTH
Thomas
 
How exactly are you doing the concatenation and when? You need to make the tempvar the entire file path and file name before using it. You can't concatenate it during the expression of the macro to do the output.
 

Users who are viewing this thread

Back
Top Bottom