Re: Subreports Not Updating in Detail Section



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!


.



Relevant Pages

  • Re: Dynamically change subreport?
    ... Then I click a command button on this main form, and that fires off a report, which is based on a query which refers back to the customer combo box on the form. ... That report has two subreports, whose record sources are queries which also refer back to controls on the original form, including the customer. ... Instinct tells me I don't want to maintain two completely different families of reports, but that I should re-use anything I can, and include a Check-box "By Site" on the main Invoices form. ...
    (microsoft.public.access.gettingstarted)
  • RE: Display a total in a report
    ... The container report, MainInvoiceReport, contains 6 subreports of different ... The subreports are grouped by Registrant (aka Retreatant), ... What you need here are parameter queries. ...
    (microsoft.public.access.gettingstarted)
  • Re: Dynamically change subreport?
    ... Then I click a command button on this main form, and that fires off a report, which is based on a query which refers back to the customer combo box on the form. ... That report has two subreports, whose record sources are queries which also refer back to controls on the original form, including the customer. ...
    (microsoft.public.access.gettingstarted)
  • Dynamically change subreport?
    ... Then I click a command button on this main form, and that fires off a report, which is based on a query which refers back to the customer combo box on the form. ... That report has two subreports, whose record sources are queries which also refer back to controls on the original form, including the customer. ...
    (microsoft.public.access.gettingstarted)
  • Re: Subreports based on user input from queries
    ... I have 4 queries which are needed to generate this one report. ... these queries into reports it requeries Query1 over and over again asking ... Is there a way to get the subreports to reference the main report? ...
    (microsoft.public.access.reports)