Report skips data

Mgomp

Registered User.
Local time
Today, 18:35
Joined
May 1, 2009
Messages
40
Hi all.

I have a problem which I cant't undersetand.

I have something I would call a nesting report;
First - I print a "froontpage" for one customer.
Second, - I print all "invoices" for this customer.
Next, a frontpage for the next customer, and then all invoicec for this customer.
The code which runs the reports, are something like this:

rsCust.Open "SELECT * FROM Customer",,adOpenKeyset, adLockOptimistic

Do While Not rsCust.EOF
txtCustID = rsCust!CustomerID
DoCmd.OpenReport stDocNameA, acNormal 'stDocNameA are a summary reoport for each "customer"
rsDetail.Open "SELECT * FROM Detatils Where rsDetail.CustiID = "' & [txtCustID] "'",,adOpenKeyset, adLockOptimistic

DO While Not rsDetail.EOF
DoCmd.OpenReport stDocNameB, acNormal 'stDocNameB are a "invoice like" report
rsDetail.MoveNext
Loop
rsDetail.Close

rsCust.MoveNext
Loop

The problem is, the second report - Details(Invoice) - sometimes print blank pages (layout but with no data), and sometime it skips details. I mean, If the detail should be 6 seperate report output, it somtimes skips e.g. report no 4 and 5. Next time, it could skip report 2 and 3 for no reason... It just skipping reports in random sequence.


The whole report could generate several hundred pf pages, and the Detail/Invoice for each Customer could easily generate 50 to 100 pages. The error occurs completly randomly.

Does anybody understand what I am doing wrong - or maybe can give me a hint to a better soulution?

Regards.
 
Last edited:
No idea. Maybe there's some bottle necking going on. You're firing lots of reports in a short period.

I would expect that you can do what you want by just using the report grouping options i.e. everything on one report.

Customer would be a group level and you could have a nice big group header for customer to show all the customer info. Then you force a page break at the end of this group header. Then your next group level is your invoices etc..

Chris
 
Hi

Yes, collecting all in one report, grouping and the use of pagebrake may solve it. But splitting it up like i did works so fine for creating complete stand-alone report fir each "invocie".
Back to studing reports...
 

Users who are viewing this thread

Back
Top Bottom