Parameter VBA

smove11

New member
Local time
Today, 09:58
Joined
Feb 8, 2013
Messages
2
I am new to VBA and want to create a code for a report I have. I run the report on multiple times with different parameters.

What I would like to do is create a code that will refer to a table and create report for each parameter.

For example, I have 5 different parameters in the table. I want it to grab the first one, create a report and save as PDF and then go to the next parameter in the table and do the same until all the it has gone through the table of parameters.
 
Create a recordset on the table of parameters. Loop through the recordset to insert the value into the parameters collection of the report's recordsource query and generate the reoprt.
 
Can you give me an example of how the code would be written? Can I have it set to save off the generate report in a folder?
 
Dim rst as recordset
Set rst=Currentdb.OpenRecordset("tableName/QueryName")
While Not rst.EOF
your code goes here for export to pdf
wend

set rst=nothing
 

Users who are viewing this thread

Back
Top Bottom