Report RecordSource property issue in Access 2002 - TechRepublic
Question
April 26, 2007 at 03:37 PM
ag691234

Report RecordSource property issue in Access 2002

by ag691234 . Updated 19 years, 2 months ago

I have a need to change the saved Report’s RecordSource property from VBA code. The record source is one of several saved queries. when the user clicks a command button on a form, the code checks which is the appropriate query to run, and then need to set the RecordSource for a specified report.

The issue I have is when I assign the RecordSource property value in VBA code, I get en error message “You cant set a record source property in print preview or after printing has started.” It seems that by assigning the value in format of:
Report_Name.RecordSource = variableName, the code causes the report to be opened.

I need to change the RecordSource property value, then run the report: DoCmd.OpenReport stDocName, acPreview.

Any help on achieving the goal of changing RecordSource property of a report from VBA code in Access 2000 is appreciated.

This discussion is locked

All Comments