Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Separate Report for each Customer

Status
Not open for further replies.

plehdeen

Programmer
Mar 7, 2001
5
US
I have a series of queries ending in a report. Have been able to generate reports for all customers at once (over 200 with balances) and also been able to select customer and print an individual statement for the one customer from a form.

What I am trying to do is to print a series of separate reports one for each customer that has a balance.
Please help!
Thanks!

 
Hi Plehdeen!
One method is to apply a "where condition" filter to the report before: perhaps another command button on your form captioned "all with balances"...you choose :), in the "on click" event for this command you can open the same report but in this case change the open report line to something like this:

DoCmd.OpenReport "NameOfYourReport", acViewPreview, , "[FieldWithABalance] > 0"

Let me know if this gives you the results you're after...If not we'll do somemore! Gord
ghubbell@total.net
 
Thanks for your assistance. I've taken a slightly different approach and am running into challenges.
Here is what I have so far....

Dim stDocName As String
stDocName = "rptStatementAll"
Dim rstUC As Recordset
Dim qdfCR As QueryDef

Set rstUC = CurrentDb.OpenRecordset("qryReportCust")
Set qdfCR = CurrentDb.QueryDefs("qryReportDetail")

rstUC.MoveFirst

Do Until rstUC.EOF
qdfCR.Parameters.CUS_NO = rstUC!CUS_NO

DoCmd.SendObject acReport, stDocName, acFormatHTML, rstUC!CUS_NO, , , rstUC!CUS_NO, , False, ("i:\databases\logo.html")
Loop

The challenges are:
1 - Error Message "Too few parameters. Expected 2.
2 - Doesn't seem to be using the HTML file as template.

Would appreciate any light you could shed on the subject.
Thanks!
 
Im sincerely not familiar with this approach however I see one small boo boo (very technical): DoCmd.SendObject acReport, stDocName, acFormatHTML, rstUC!CUS_NO, , , rstUC!CUS_NO, , False, ("i:\databases\logo.html")

Should be:

DoCmd.SendObject acSendReport, stDocName, acFormatHTML, rstUC!CUS_NO, , , rstUC!CUS_NO, , False, ("i:\databases\logo.html")

And I don't believe that your customer number is being found because of a compilation error to do with the QueryDef.Parameter -which doesn't seem to "be" (I don't think you can do that- at least not this way?)

How do you get your send to all report "going"?
Puzzled but still trying, Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top