G
Guest
I have set up code to send out our new purchase orders on a nightly basis to
the vendor. I would like to skip over any purchase order that is blank so it
doesn't fax. I am not sure how to go about doing this. Any help would be
appreciated.
Thanks,
Lisa
I have attached the code below:
Option Explicit
Public strPurchaseOrderWhere As String
Function FaxInvoices()
'VendorFax is the table that holds the vendor fax numbers
Dim LBNightly As Database
Dim rstvendorfax As Recordset
Set LBNightly = CurrentDb()
Set rstvendorfax = LBNightly.OpenRecordset("vendorfax", dbOpenDynaset)
With rstvendorfax
Do Until .EOF
'Filter to find purchase orders belonging to each vendor in vendor fax
strPurchaseOrderWhere = "[Vendorname] ='" & ![VendorName] & "'"
DoCmd.SendObject acReport, "PurchaseOrder", acFormatSNP, "[FAX: " &
![Fax] & "]", , , , , False
.MoveNext
Loop
End With
rstvendorfax.Close
End Function
the vendor. I would like to skip over any purchase order that is blank so it
doesn't fax. I am not sure how to go about doing this. Any help would be
appreciated.
Thanks,
Lisa
I have attached the code below:
Option Explicit
Public strPurchaseOrderWhere As String
Function FaxInvoices()
'VendorFax is the table that holds the vendor fax numbers
Dim LBNightly As Database
Dim rstvendorfax As Recordset
Set LBNightly = CurrentDb()
Set rstvendorfax = LBNightly.OpenRecordset("vendorfax", dbOpenDynaset)
With rstvendorfax
Do Until .EOF
'Filter to find purchase orders belonging to each vendor in vendor fax
strPurchaseOrderWhere = "[Vendorname] ='" & ![VendorName] & "'"
DoCmd.SendObject acReport, "PurchaseOrder", acFormatSNP, "[FAX: " &
![Fax] & "]", , , , , False
.MoveNext
Loop
End With
rstvendorfax.Close
End Function