open report with a different table source

  • I want to open a report and use a different table that has the same fields necessary for the report. I tried this below but does not work.

    myReportName = "VendorVolume"

    sqlstr = "select * from [dbo_FactApHistory2015]"

    DoCmd.OpenReport myReportName, acViewReport, , , , sqlstr

  • I figured it out.

    Reports("mytable").recordsource = "Select * from mytable"

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply