Re: Subreports Not Updating in Detail Section
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Wed, 8 Feb 2006 11:51:28 +0800
Queries and reports cannot read VBA variables directly, so it makes sense to
use a function call to get the value of the Customer ID. Sounds like there
is some kind of timing problem with the way this value is retrieved.
You might work around that issue by using the
LinkMasterFields/LinkChildFields of the each subreport, instead of having
the function call in the queries of the subreport.
If you already have a text box on the main report that contains the Customer
ID value, just include the name of that text box in the subreport's
LinkMasterFields property, and the name of the matching field in the
subreport into its LinkChildFields.
If the main report does not have the CustomerID value, you could add a text
box with control source of:
=MyFunc()
so that it makes the function call at the time it is needed. You still use
the name of the text box in LinkMasterFields, and the timing issue is
resolved. (The function call is omitted from the queries.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Jeff Polack" <JeffPolack@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:601818D9-0A9A-46A2-989B-2AB826374AFF@xxxxxxxxxxxxxxxx
I have a report with a number of subreports located in the detail section.
Each of the subreports represent the results from various queries that all
tie to the same Customer ID. The Customer ID is found in a properly
defined
public variable. The value of the variable is changed through a function
in
a group header On Format event.
Here's the problem: The function that updates the variable is functioning
properly (i.e., places the new customer ID in the varialbe when the
customer
changes). Each query that is basis for a subreport is able to access the
new
global variable value and is functioning properly, independent of the
report.
Each of the subreports is functioning properly, independent of the "host"
report. However, the subreports are not refreshing/requerying when viewed
in
the "host" report. Instead, all of the subreports show the results of the
various queries for the last Customer ID that was placed in the global
variable the last time the report was run. So, instead of updating the
subreports for each client, I end up with the same incorrect data for all
Customers.
Any ideas as to why the subreports are not updating despite each component
(update global variable, source query, source subreport) is properly
functioning?
Thanks in advance for your time!
.
- Follow-Ups:
- Re: Subreports Not Updating in Detail Section
- From: Jeff Polack
- Re: Subreports Not Updating in Detail Section
- Prev by Date: Re: Multiple Copies of a report
- Next by Date: Re: Repeating Details
- Previous by thread: Re: PDF Conversion
- Next by thread: Re: Subreports Not Updating in Detail Section
- Index(es):
Relevant Pages
|