M
Michael
I have the following code that I began to work on last week and got
inturupted and now I have lost where i had found the code and cannot get it
to work.
Option Explicit
Public strInvoiceWhere As String
'****************************************************************
'This function will walk through the Customers table and fax the
'Invoice report that is filtered by the CustomerID field by using
'MS Fax through the MS Access SendObject.
'
'This function assumes that the Invoice report has the default printer
'set to MS Fax, and that the MS Fax driver is installed correctly.
'****************************************************************
Function FaxPurchaseOrder()
Dim ragonew As DAO.Database
Dim rstPOSuppliers As DAO.Recordset
Set ragonew = CurrentDb()
Set rstPOSuppliers = ragonew.OpenRecordset("POSuppliers", _
dbOpenDynaset)
If MsgBox("Do you want to fax Purchase Order" & Chr(13) & _
"to all customers who are using Microsoft Fax?", 4) = 6 Then
With rstCustomers
Do Until .EOF
'Create the Invoice report Filter
'that is used by the Report_Open event.
strInvoiceWhere = "[SupplierID] = '" & ![SupplierID] & "'"
DoCmd.SendObject acReport, "Purchase Orders", acFormatRTF, _
"[FaxNumber: " & ![FaxNumber] & "]", , , , , False
.MoveNext
Loop
End With
End If
rstPOSuppliers.Close
End Function
inturupted and now I have lost where i had found the code and cannot get it
to work.
Option Explicit
Public strInvoiceWhere As String
'****************************************************************
'This function will walk through the Customers table and fax the
'Invoice report that is filtered by the CustomerID field by using
'MS Fax through the MS Access SendObject.
'
'This function assumes that the Invoice report has the default printer
'set to MS Fax, and that the MS Fax driver is installed correctly.
'****************************************************************
Function FaxPurchaseOrder()
Dim ragonew As DAO.Database
Dim rstPOSuppliers As DAO.Recordset
Set ragonew = CurrentDb()
Set rstPOSuppliers = ragonew.OpenRecordset("POSuppliers", _
dbOpenDynaset)
If MsgBox("Do you want to fax Purchase Order" & Chr(13) & _
"to all customers who are using Microsoft Fax?", 4) = 6 Then
With rstCustomers
Do Until .EOF
'Create the Invoice report Filter
'that is used by the Report_Open event.
strInvoiceWhere = "[SupplierID] = '" & ![SupplierID] & "'"
DoCmd.SendObject acReport, "Purchase Orders", acFormatRTF, _
"[FaxNumber: " & ![FaxNumber] & "]", , , , , False
.MoveNext
Loop
End With
End If
rstPOSuppliers.Close
End Function