none
report prints on correct printer and on the correct COM3 port but freezes access and nothing prints

    Question

  • Good morning everyone,

    I can't figure out why a report will print normally when selecting preview - right-click and print, but as soon as I try to print the same report using VBA code, it seems to try to send the report to the right printer on COM3, but suddenly access freezes.

    When I go to check on the printers' properties, I can see that the report was sent to the right one, however, instead of printing in the "Status" section it says "Mise en file d'attente" meaning that the document is put in a waiting state.

    A) This is the code I use to print the report:

    DoCmd.OpenReport "MercuryPrintDataDeclinedErrorsOthers", acNormal, , "[InvoiceNo]=" & [InvoiceNumber] & ""
        DoCmd.PrintOut

    Even if I remove the DoCmd.PrintOut, it does exactly the same.

    B) This is when I use the preview, right-click and print:

    What should I try, I did tried many other way to print, all other reports print correctly but this one, any ideas?

    Thanks

    Claude from Quebec


    Claude Larocque

    Wednesday, December 12, 2012 2:56 PM

Answers

  • Yes I did check and it was not, however, while I was expecting an answer, I continue to search and look at this:

    On the Form_close event, I had these 2 possibilities:

    If Me.CardType = "DEBIT" And Me.TranCode = "EMVSale" Then

    and on the same event:

    If Me.CmdStatus = "Declined" then

    and guess what, in the table, the CardType was "DEBIT", the TranCode was "EMVSale" and the cmdStatus was "Declined".

    I did add on the first code: and Me.cmdStatus = "Approved"

    and the report printed as it should.... nothing then the perseverance to find what seems to be an Access's bug... it this case it was a Claudes' bug...;)

    Thanks for your input


    Claude Larocque



    Wednesday, December 12, 2012 4:17 PM

All replies

  • Claude

    Did you check the Page Setup to see if maybe the report itself has a printer other than the default one?


    Bill Mosca
    http://www.thatlldoit.com
    http://tech.groups.yahoo.com/group/MS_Access_Professionals

    Wednesday, December 12, 2012 3:14 PM
  • Yes I did check and it was not, however, while I was expecting an answer, I continue to search and look at this:

    On the Form_close event, I had these 2 possibilities:

    If Me.CardType = "DEBIT" And Me.TranCode = "EMVSale" Then

    and on the same event:

    If Me.CmdStatus = "Declined" then

    and guess what, in the table, the CardType was "DEBIT", the TranCode was "EMVSale" and the cmdStatus was "Declined".

    I did add on the first code: and Me.cmdStatus = "Approved"

    and the report printed as it should.... nothing then the perseverance to find what seems to be an Access's bug... it this case it was a Claudes' bug...;)

    Thanks for your input


    Claude Larocque



    Wednesday, December 12, 2012 4:17 PM
  • A Claude's bug...Funny! Glad you found the cause.


    Bill Mosca
    http://www.thatlldoit.com
    http://tech.groups.yahoo.com/group/MS_Access_Professionals

    Wednesday, December 12, 2012 6:45 PM