Syntax for Passing a Variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 
Back
Top