Access 2010 SP1 – Reports that are opened programmatically are no longer showing the expected filtered set of records

 

Issue:

After installing Office 2010 SP1, when specifying a WhereCondition parameter in an OpenReport method AND setting the target report's record source in the report's open event, the WhereCondition parameter is not applied.  The problem will manifest even in cases where the recordsource property is not changing from its original setting.

 

Workaround:

Microsoft is aware of the issue and it is currently being investigated.  In order to work around the problem, you can try the following:

 

·         Filter the report records by passing writing a valid report filter statement and passing this to the report using OpenArgs.  On the report's open event, set the report's Filter property to OpenArgs, then set the report's FilterOn property to true.

·         Pass a WHERE clause to the report using OpenArgs.  On the report's open event, incorporate the OpenArgs value into a SQL statement and set the report's recordsource property to this SQL statement

·         If it isn't necessary to change the recordsource of the report, eliminate the code from the report open event where the recordsource is being set. 

·         Create a copy of the target report, base it on a different recordsource object, remove the code from the report's open event, and add code to the object from which the report is being opened that logically selects which report to open. 

 

Kirk Beller

Microsoft Online Community Support

Answer
Answer

Hi Everyone,

 

Looks like the issue has been fixed with this hotfix:

http://support.microsoft.com/kb/2596496

 

Kirk Beller

Microsoft Online Community Support

 

 

 

 

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 6,381 Applies to: