batch macro

rene65

New member
Local time
Today, 11:58
Joined
Feb 7, 2007
Messages
5
Tried this on the dutch forum but nobody could help me. I have about 40 reports which I want to be printed and exported to rtf in a directory I choose.
I have an unbound field in which the directory name is listed (here I want to output all the results). I have the following macro code (as an example):

Function batch()
On Error GoTo batch_Err

DoCmd.OpenReport "tblReadMe1", acViewNormal, "", "", acNormal
DoCmd.OutputTo acReport, "tblReadMe1", "RichTextFormat(*.rtf)", "c:\help\tblReadMe1", False, "", 0
DoCmd.OpenReport "tblReadMe2", acViewNormal, "", "", acNormal
DoCmd.OutputTo acReport, "tblReadMe2", "RichTextFormat(*.rtf)", "c:\help\tblReadMe2", False, "", 0

batch_Exit:
Exit Function

batch_Err:
MsgBox Error$
Resume batch_Exit

End Function

As you can see I have put the directory in the code ("c:\help\tblReadMe2") manually. What must I do to let this code point to my unbound field?
This field says: I:\Control\
In here all the reports must be exported in the rtf format.

Thanks.
 
you need to concatenate the value from the control into the string

DoCmd.OutputTo acReport, "tblReadMe1", "RichTextFormat(*.rtf)", me!mycontrol,False, "", 0
 

Users who are viewing this thread

Back
Top Bottom