My Assistant
![]() ![]() |
|
|
Feb 24 2012, 02:21 PM
Post
#1
|
|
|
New Member Posts: 1 |
I have an application in MS Access that was using WinFax for the purpose of faxing "Buysheets" to buyers at night after all the orders are in. WInfax does not like WIndows 7 or Access 2010. In my search for a replacement I found some code based on the Northwind DB that will be suitable for my needs. In order for me to use this - I wanted to test it with Northwind first. As I stepped through it, I enocuntered several problems - some of which had to do with the field names in the Customer table. I have stepped past that and now I get a runtime error 2485 "Cant find the object Me". In the "On Open" property of the "Invoice" report is Me.Filter = strInvoiceWhere - as per the instructions where I found the code. - I am a little stumped here. Below is the code (with my changes thus far in it) Changed because I think the code was written for an earlier MDB of Norhtwind, and the Link to the orginal code. The underlined section is where I get the error. Any help would be greatly appreciated.
Link: Original COde Code: Option Explicit Public strInvoiceWhere As String ' **************************************************************** ' This function will walk through the Customers table and fax the ' Invoice report, which is filtered by the CustomerID field using ' MS Fax through the MS Access SendObject. ' This function assumes the Invoice report has the default ' printer set to MS Fax and the MS Fax driver is installed ' correctly. ' **************************************************************** Function FaxInvoices() Dim dbsNorthwind As Database Dim rstCustomers As Recordset Dim strInvoiceWhere As String Set dbsNorthwind = CurrentDb() Set _ rstCustomers = dbsNorthwind.OpenRecordset("Customers", dbOpenDynaset) If MsgBox("Do you want to fax invoices" & Chr(13) & _ "to all customers using Microsoft Fax?", 4) = 6 Then With rstCustomers Do Until .EOF ' Create the Invoice report Filter used by the Report_Open ' event. strInvoiceWhere = "[Customer ID] = " & ![ID] DoCmd.SendObject acReport, "Invoice", acFormatPDF, _ "[fax: " & ![Fax Number] & "]", , , , , False .MoveNext Loop End With End If rstCustomers.Close End Function |
|
|
|
Feb 24 2012, 02:44 PM
Post
#2
|
|
|
Access Wiki and Forums Moderator Posts: 48,642 From: SoCal, USA |
Hi,
(IMG:style_emoticons/default/welcome2UA.gif) I haven't tried it before but perhaps what you need to do first is check if you can even send a fax out using this method. For example, create a simple one-page report and then try the following in the Immediate Window: DoCmd.SendObject acReport, "TestReport", acFormatPDF, "[fax: xxxxxxxxxx]",,,,,False Replace "xxxxxxxxx" with your fax number. Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 20th June 2013 - 01:05 AM |