Run-time error going from Report View to Print Preview (1 Viewer)

grs

New member
Local time
Today, 16:10
Joined
May 9, 2016
Messages
2
Hi Folks

First post, and I'll get my excuses in early...I'm really a GIS guy with some MS Access querying experience who's been roped in to develop a few Access reports - so apologies for my poor practice/ poor terminology/ general ignorance!

I've developed a report which works fine in Report View, but throws the error below when I switch to Print Preview mode:

Run-time error 2467 - The expression you entered refers to an object that is closed or doesn't exist.

Any suggestions on how I get round this would be much appreciated!

The report itself contains a List Box and a set of sub-reports (only 2 at the moment, but it will be around 10 when I get the functionality working).

The report has an On Load event which sets a default value for the list box and re-queries the sub-reports.

The list box has an On Click event which also re-queries the sub-reports when a new value is selected.

The sub-reports are each based on a separate aggregate query, which each take the value from the list box as one of the filter criteria (hence the need to set a default value and re-query the sub-reports when I open the report).

The sub-reports display a set of values from the aggregate query, and each value has an On Click event which opens another query in datasheet view.

As I say, all of this works fine in Report View, but I get the run-time error when switching to Print Preview, so I'm wondering if some of this functionality isn't compatible with the datasheet view? The debugger from the error message takes me to the first 'requery' event of the Report_Load event which is:

'Me.[rpt_pipeline_Design_01_AwaitingPreCheck subreport].Report.Requery'

Any thoughts/ suggestions welcomed, happy to post more info if it helps!

Thanks in advance.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:10
Joined
May 7, 2009
Messages
19,248
i've always discourage used of report for interactive purpose. use form instead.
let the report served its purpose. for reporting.
 

JHB

Have been here a while
Local time
Today, 17:10
Joined
Jun 17, 2012
Messages
7,732
That you get an error when switching from Report view to Print Preview can be caused that not all events will be trigged in Report view.
 

grs

New member
Local time
Today, 16:10
Joined
May 9, 2016
Messages
2
arnelgp, JHB - thanks for replying, I'll try building in a form instead of a report and see how I get on.
 

Users who are viewing this thread

Top Bottom