General information
Title:
Each page of the Report needs to be a separate print job
We have an Access Report that prints collection letters for all customers meeting the criteria for query "0-30 letter". The record source for the report is set to "0-30 letter" (the query). This runs fine, however, we now need to automatically fax (using winfax) each letter to the appropriate customer. In order to fax each separate page to a new fax number, it appears that we need to have each page be a separate print job. We have tried the following code in VB to call the OPENREPORT command with a where clause to print only one customer at a time but it is not working. Does anyone have any ideas on how we can print each page (customer) as a new print job?
Rem Begin SA code
Dim dbs As Database, rst As Recordset
Dim rstLetter1 As Recordset, strSQL As String
Dim strCustno As String
' Return reference to current database.
Set dbs = CurrentDb
' Create table-type Recordset object.
Set rstLetter1 = dbs.OpenRecordset("0-30 LETTER")
Do
Debug.Print rstLetter1.CUSTNO.Value
strCustno = rstLetter1.CUSTNO.Value
stDocName = "1-30 Letter"
DoCmd.OpenReport stDocName, acViewPreview, , rstLetter1.CUSTNO.Value = strCustno
rstLetter1.MoveNext
Loop Until rstLetter1.EOF
' Free all object variables.
rstLetter1.Close
Set dbs = Nothing
Rem end SA code
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only