Results 1 to 12 of 12
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The code sends a fax for each record in the form that contains the command button Command6., and updates the record to set Quote Faxed to True.

    Does the record source of the form select only the records for which Quote Faxed is False? If it includes records for which Quote Faxed is True, a fax will be sent each time.

    Otherwise, could the Quote Faxed be set to False by someone else or by some other code? That would cause the fax to be sent again too, even if the form only shows records with Quote Faxed = False.

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    This is my third attempt at responding to this since it doesn't seem to be taking.

    >>Does the record source of the form select only the records for which Quote Faxed is False? If it includes records for which Quote Faxed is True, a fax will be sent each time.

    I'm attaching the sql for the query that the form is bound to. I'm not sure if the piece that is red is needed or what its doing, as I didn't write this. However, according to the user its been working fine until recently.

    SELECT DISTINCTROW First([Vendor List].[Vendor Name]) AS [FirstOfVendor Name], Count([Vendor List].[Vendor Name]) AS [CountOfVendor Name], [Vendor List].[Vendor Number], [Vendor List].Phone, [RFQ Details].emailsent
    FROM [Vendor List] INNER JOIN [RFQ Details] ON [Vendor List].[Vendor Number] = [RFQ Details].[Vendor Number]
    GROUP BY [Vendor List].[Vendor Number], [Vendor List].Phone, [RFQ Details].emailsent, [Vendor List].[Vendor Name], [RFQ Details].[Quote Faxed]
    HAVING (((Count([Vendor List].[Vendor Name]))>0) AND (([RFQ Details].emailsent)=No) AND (([Vendor List].[Vendor Name]) In (SELECT [Vendor Name] FROM [Vendor List] As Tmp GROUP BY [Vendor Name] HAVING Count(*)>0 )) AND (([RFQ Details].[Quote Faxed])<>Yes))
    ORDER BY [Vendor List].[Vendor Name];


    >>Otherwise, could the Quote Faxed be set to False by someone else or by some other code? That would cause the fax to be sent again too, even if the form only shows records with Quote Faxed = False.


    They can manually mark a quote as faxed but if they do they don't come up in the above query, which is fine. At the end of the day they run the fax report and the records that are in the list are correct. The issue is that there are faxes that are sent that are old and were sent before and there is no pattern behind why this is happening. I can't find anything in the database and unfortunately don't know winfax well enough to know if it stores anything that has been deleted in old memory.

    Leesha

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I'm afraid it's impossible for me to solve this. Sorry!

  5. #5
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    OMG Hans! That sent a chill down my spine! If you can't solve it I never will. Is it safe to say that the database looks OK from what I've sent??

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Just looking at the code doesn't help much. I'd have to see (a copy of) the database.

  7. #7
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    I'll try to strip it down to a small enough size. My problem is that I don't know the database that well and don't want to miss giving you something you need.

  8. #8
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    OK, here's the database. Click the big button that says "nightly fax list". I've set it so that there are faxes that are due to go out.

    Leesha
    Attached Files Attached Files

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    As far as I can tell, the code works as intended. The Quote Faxed field is set to True, and this prevents the record from being faxed again.
    There is no code that sets Quote Faxes to False.
    So the only thing I can think of is that someone must manually have reset the Quote Faxed field to False...

  10. #10
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    Well, the bright side is at least I'm getting better at reading code! I couldn't see anything wrong either. I'm convinced its something with the winfax retaining faxed history somewhere in memory.

    The owner of the database is wondering if it has anything to do with the email portion of the code. Again, I don't believe this is the case since not all duplicated faxes had email with them. Could you do me a favor and click the button labeled "RFQ Entry" and then code behind the button that says "Email RFQ" and "Email with Pic". This also has been working fine till the recent problems and I just want to be sure there is no glitch here, since this my code that I added with your help a couple of years ago.

    Thanks!
    Leesha

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    That code looks OK too...

  12. #12
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks Hans! I really appreciate it. Now on to investigate user error and winfax!

    Leesha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •