Hi,
I’m trying to help out a friend who has a database that was built in version 2000 and then upgraded to 2002 SP3 by me a few years ago when he wanted the ability to email RFQ’s. This has all worked fine for 2 years. Recently, they started getting complaints from vendors who are receiving duplicate faxes (they also fax RFQ’s) for faxes that were sent months ago. There is no rhyme nor reason behind which faxes are regenerated. I’m thinking that its winfax but have yet to find anything similar. So, I’m posting the code that generates the faxes to see if anyone can see any issues. I’ve verified that the tables are in fact being checked when the fax is sent. Since I didn’t write this code I’m not sure if I’m missing anything when reading it, but it looks OK to me, AND it was working fine till about 3-4 months ago.
Thanks!
Leesha
Sub Command6_Click()
‘Fax All
Dim rs As Recordset
Set rs = Me.RecordsetClone
Dim chan As Variant
Dim vNum As Variant
Dim ChanNum As Variant
‘ChanNum = DDEInitiate(“FAXMNG32”, “CONTROL”)
‘DDEExecute ChanNum, “GoIdle”
‘DDETerminate ChanNum
‘chan = DDEInitiate(“FAXMNG32”, “Transmit”)
rs.MoveLast
rs.MoveFirst
Do While True
If rs.EOF Then
Exit Do
End If
DoEvents
‘DDEPoke chan, “Fax Number”, rs![Phone]
Dim recpstr As String
recpstr = “recipient(“”” & rs![Phone] & “””)”
‘MsgBox recpstr
chan = DDEInitiate(“FAXMNG32”, “TRANSMIT”)
DoEvents
DDEPoke chan, “sendfax”, recpstr
‘DDEPoke chan, “sendfax”, “showsendscreen(“”0″”)”
DoEvents
DoCmd.OpenReport “aaprint”, , , “[vendor list].[vendor name] = ‘” & rs![FirstOfVendor Name] & “‘”
DDETerminate chan
DoEvents
vNum = rs![Vendor Number]
DoCmd.SetWarnings False
DoCmd.RunSQL “UPDATE DISTINCTROW [RFQ Details] SET [RFQ Details].[Quote Faxed] = True WHERE ((([RFQ Details].[Quote Faxed])Yes) AND (([RFQ Details].[Vendor Number])= ” & vNum & “));”
sSleep (5000)
rs.MoveNext
Loop
‘ChanNum = DDEInitiate(“FAXMNG32”, “CONTROL”)
‘DDEExecute ChanNum, “GoActive”
‘DDETerminate ChanNum
‘DDETerminateAll
End Sub