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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse report for faxing 1

Status
Not open for further replies.

rugbyguy

Technical User
Jun 25, 2004
14
CA
Hello,

I have a report that I created (births). I have set it up so that when I print, it sends it directly to WINFAX for faxing to a community.

The problem is as follows: I have set up my query so that it groups by community. I can either print up a report for 1 community or for all communities. The 'all communities' option will print a report with each individual community on a separate page. In essence what I would like to do is automate the process of faxing individual reports to all the communities.

As opposed to sending to fax 28 single reports, I would like to select 'all communities' and have it automatically send out 28 reports instead of the 1 report it currently generates (single report with 28 pages)

Hope this wasn't too convoluted!

Advice appreciated.

 
Are you using the DoCmd.OpenReport method? If so, you just need to set up a loop that iterates once for each community and prints a report using the Where parameter of the OpenReport method. Something like this:
Code:
Dim dbsCurr as DAO.Database
Dim rsCommunities as DAO.Recordset

Set dbsCurr = CurrentDb()
Set rsCommunities = dbsCurr.OpenRecordset("select CommunityID from CommuityTable")

rsCommunities.MoveLast : rsCommunities.MoveFirst

Do Until rsCommunities.EOF
   DoCmd.OpenReport "rptIndividualCommunityReport", , , "CommunityID = " & rsCommunities!CommunityID

Loop

You would need to incorporate any faxing logic inside of the loop as well.

Good luck

-Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top