D
DJ
My database provides an option to print a form, however, in order to change
the record source for the report on the fly, I first open the report in
design view to select the correct query. See below:
stRecSrc = "SingleSheet"
DoCmd.OpenReport "Event", acViewDesign
Reports!Event.RecordSource = stRecSrc
DoCmd.Close acReport, "Event", acSaveYes
DoCmd.OpenReport "Event", acPreview
The report works fine when the DB is saved as an MDB, however, If I use it
as an MDE if fails due to "command not available in MDE". I presume this is
because I am attempting to open the report in edit mode temporarily. I need
to select the record source on the fly because I am using the report format
repeatedly for varying selections of data.
Is there any simple way around this?
the record source for the report on the fly, I first open the report in
design view to select the correct query. See below:
stRecSrc = "SingleSheet"
DoCmd.OpenReport "Event", acViewDesign
Reports!Event.RecordSource = stRecSrc
DoCmd.Close acReport, "Event", acSaveYes
DoCmd.OpenReport "Event", acPreview
The report works fine when the DB is saved as an MDB, however, If I use it
as an MDE if fails due to "command not available in MDE". I presume this is
because I am attempting to open the report in edit mode temporarily. I need
to select the record source on the fly because I am using the report format
repeatedly for varying selections of data.
Is there any simple way around this?