Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Nov 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    print one record to winfax (2000)

    I was using access97 and 2 tables and this worked. Now I am using access2000 and 1 table. can't get it to work. The line with the problem, I think, is DoCmd.OpenReport DocName, , "fax", "[CUSTNUM] = '" & ![CUSTNUM] & "'". It doesn't seem to pickup the where condition. table is faxlet. query, if I need it is fax. Report is faxrep. Trying to link on CUSTNUM. Using winfax 10.3
    thanks for any help!
    Jim

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: print one record to winfax (2000)

    Welcome to Woody's Lounge.

    In the statement

    DoCmd.OpenReport DocName, , "fax", "[CUSTNUM] = '" & ![CUSTNUM] & "'"

    the third argument "fax" is the Filter argument, and the fourth argument "[CUSTNUM] = '" & ![CUSTNUM] & "'" is the WhereCondition argument. It is unusual (although not forbidden) to specify both. What happens if you omit "fax"?

  3. #3
    New Lounger
    Join Date
    Nov 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: print one record to winfax (2000)

    I have been trying everything, at one time I had "fax" not there. I have removed it again. I have 2 records in my test table. If I take out the loop statement it just sends the first record data to winfax and it looks correct. If at the beginning I go to the 2nd (last record) it also sends one record, the last record to winfax and looks correct. If I have it loop and movenext it sends 2 records to winfax, but they both contain the data for the first record. Before I send the report, on each loop, I get the customer name and number and send them to winfax as header data, the name shows correctly but the subject (account number) both are the last account number. This just is not making any sense and I have spent hours on this and have no idea now where to look for the problem.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: print one record to winfax (2000)

    It's impossble to guess what's happening from the one line of code you have shown us. Could you post the complete procedure, or at least the relevant part of it?

  5. #5
    New Lounger
    Join Date
    Nov 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: print one record to winfax (2000)

    rs.MoveFirst
    'rs.MoveNext

    With rs
    Do Until .EOF

    If Not IsNull(rs!BFAX) Then
    faxnumber$ = rs!BFAX
    subject$ = rs!CUSTNUM
    account$ = rs!CUSTNUM
    recipient$ = rs!BNAME


    '************************************************* ********
    Const DDE_ERROR = 282
    Const MAXINT = 32767

    Dim varBookmark As Variant


    On Error GoTo StartUp
    startapp = DDEInitiate("FAXMNG32", "Control")
    On Error GoTo 0
    GoTo FaxPoke:
    StartUp:
    If Err = DDE_ERROR Then
    temp = Shell("C:Program FilesWinFaxFAXMNG32.EXE", 6)
    Resume
    Else
    startapp = Err + MAXINT
    Resume Next
    End If

    FaxPoke:
    On Err GoTo Err_Fax_Click


    DocName$ = "faxrep"

    channum = DDEInitiate("FAXMNG32", "Transmit")
    comma$ = ",,"
    faxnumber$ = Chr$(34) & faxnumber$ & Chr$(34) & Chr$(44)
    recipient$ = Chr$(34) & recipient$ & Chr$(34) & Chr$(44)
    company$ = ""
    company$ = Chr$(34) & company$ & Chr$(34) & Chr$(44)
    subject$ = Chr$(34) & subject$ & Chr$(34) & Chr(44)
    DDEPoke channum, "Sendfax", "recipient(" & faxnumber$ & comma$ & recipient$ & company$ & subject$ & ")"
    DDEPoke channum, "sendfax", "showsendscreen(" + Chr$(34) + "0" + Chr$(34) + ")"
    DoCmd.OpenReport DocName, , , "[CUSTNUM] = '" & ![CUSTNUM] & "'"

    DDETerminate channum
    Else
    nofax = "True"
    End If
    rs.MoveNext
    Loop
    End With
    rs.Close

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: print one record to winfax (2000)

    I'm sorry, I have no experience whatsoever with the DDE commands you use, so I can't help with this.

  7. #7
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: print one record to winfax (2000)

    In order to debug your problem, I would suggest you comment out all error handling - at the moment you have several resume statements that may be masking what is going on. You should also be aware that DDE is a very old technology and generally not recommended for this kind of thing. It's been around since at least Excel 3 and the comparable version of Word, and has always been quite flakey. The current recommendation for this kind of thing is to use Automation - since you are working with Access 2000 you presumably have Outlook 2000. The later is capable of working with products such as WinFax, and gives you much better results. <!mskb=209948>Microsoft Knowledge Base Article 209948<!/mskb> gives you some information on how to automate Outlook to send an email or a fax. If you haven't worked with automation, you might find our brief Automation Tutorial useful.
    Wendell

  8. #8
    New Lounger
    Join Date
    Nov 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: print one record to winfax (2000)

    Thanks to all. I have fixed the problem and it is working ok as it did back in access97. Thanks to Wendell I will look at newer technology to replace the old access97 dde solution.

    regards,
    Jim

Posting Permissions

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