Syntax for Passing a Variable

R

Ross

I want to pass variables instead of specific report names but can't seem to
get it to work.

This Works:
Set objRpt = .Reports!DB1_rpt3_control_totals

How can I replace "DB!_rpt3_control_totals" with a variable, "strReportName"?

This Does not work:
Set objRpt = .Reports! & """ strReportName """

I am havng troulble finding the correct syntax with the syntax.

Thank You

Ross
 
M

Marshall Barton

Ross said:
I want to pass variables instead of specific report names but can't seem to
get it to work.

This Works:
Set objRpt = .Reports!DB1_rpt3_control_totals

How can I replace "DB!_rpt3_control_totals" with a variable, "strReportName"?

This Does not work:
Set objRpt = .Reports! & """ strReportName """


Try this:

Set objRpt = .Reports(strReportName)
 
Top