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
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.
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"
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
DO While Not rsDetail.EOF
DoCmd.OpenReport stDocNameB, acNormal 'stDocNameB are a "invoice like" report
rsDetail.MoveNext
rsDetail.MoveNext
Loop
rsDetail.Close
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: