[AccessD] Question on Refreshing Data on Access 2007 Report (with Sub-Report)

Brad Marks BradM at blackforestltd.com
Sat Nov 10 07:24:08 CST 2012


All,

We have a report that is pulling data from two separate databases via ODBC (Pervasive and Firebird).

The "parent" report is pulling data from the Pervasive database and a sub-report is pulling data from the Firebird database.  This is accomplished via two separate queries.  This works very nicely.

Recently there has been a request to add a feature that would enable our Sales Staff and Customer Service Reps to specify data that would "filter" the information that they are shown on the report.

To provide this feature, I have added several buttons to the report.  Each of these buttons opens up a little form which is used to obtain the string that the users would like to use for their filter.  When the button on the "Filter Form" is pushed, a VBA routine is invoked.  This VBA routine changes the query-defs of the two underlying queries.  If I look at the underlying queries, I can see that they are being changed correctly and they are returning the data correctly.

The catch is that the data shown on the report is not automatically changed.  I thought that invoking a "Requery" would refresh the data on the report after the data returned by the changed queries has been updated but it does not do so.

The only way that I have been able to get this to work is to close and re-open the report after the two query defs have been changed by the VBA code.  This works, but I am curious if there is a better solution.

Thanks,
Brad  



More information about the AccessD mailing list