Syntax for Passing a Variable

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top