Results 1 to 15 of 15
  1. #1
    Join Date
    Sep 2001
    Posts
    175

    Unanswered: Report not printing properly

    I created a report to print receipts on continuous paper. However after
    the first one prints, the second one starts lower on the paper and so on. In
    other words I have to keep ejecting and loading the paper after each receipt is printed in order to have it printed properly

    Initially there was a similar report for the invoices which works fine. I took
    a copy of that report and used it for the receipts but without success.

    I would appreciate any help I can get with this.

    Regards
    Toukey

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You probably have to adjust the page settings of the report (margins, etc.) according to the printer you use.
    Have a nice day!

  3. #3
    Join Date
    Sep 2001
    Posts
    175
    Thanks but I already tried that. The first receipt prints perfectly but after that it prints a line lower all the time.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What does a "receipt" entail? Are you forcing a page break after the final footer section for a given receipt? I'd wager the first receipt is not printing perfectly. It sounds like every single receipt (including the first one) is emitting an additional line at the end.

    What did you try with regard to the margins?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Sep 2001
    Posts
    175
    Hi Teddy,

    My margins are set at:

    T = .166
    B = .166
    L = .75
    R = .25

    My Report header is empty. My Page header contains a Logo and lables and its .875" high. The Can Grow and Can Shrink properties are set to No and Force New Page is set to None.
    In my Details Section I have fields based on a query on the table and this is 4.1667" high. The Can Grow and Can Shrink properties are set to No and Force New Page is set to None.
    The Force New Page property on my Report and Page Footers are set to None.

    Toukey

  6. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Try putting a box around the receipt info. I find that putting a box around the info helps me see where it's actually mis-spacing between the sections/pages. Sometimes I've had to change the X and Y values of the report but it seems to me like you're possibly off by just a hair. (When I design custom labels, they are a pain because I'm moving millimeters to get it to print correctly on all printouts.

    I'm guessing there's nothing in the report label designer (wizard) which would be close to your needs that you could start with and then adjust?

    I will usually print 1 and then hold it up to the light against the others to help see where I'm off.

    If all else fails, try removing the logo and adjusting, then add the logo back in to see if that's possibly the problem. Can you put the Page header info into the detailed section and remove the Page header? That's usually easier to work with in these types of spacing situations. For some reason, I found having a Page Header can sometimes throw off spacing.
    Last edited by pkstormy; 04-07-10 at 01:50.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  7. #7
    Join Date
    Sep 2001
    Posts
    175
    Thanks alot for your suggestions. I will give that a try.

    Toukey

  8. #8
    Join Date
    Sep 2001
    Posts
    175
    ok - I removed everything (incl. logo) from my page header into my details section. In the details section I put a box around everthing and removed my page header section. My report now consist of only a detail section.

    When I did the test print, the second print is still dropping and the additional space is on the top i.e. for every print other than the first it drop like a line then starts printing the top of the box etc. Could the code from my print button be causing this? Here's the code:

    Private Sub prtbutton_Click()
    On Error GoTo Err_prtbutton_Click

    Dim strDocName As String
    Dim strFilter As String

    strDocName = "Receipt"
    strFilter = "ReceiptNo = Forms!frmrecbatch!receiptno"
    DoCmd.OpenReport strDocName, acViewPreview, , strFilter

    DoCmd****nCommand acCmdFitToWindow
    'SendKeys "^{DOWN}"


    Dim PgFrom As Integer, PgTo As Integer

    PgTo = Reports("Receipt").Pages
    PgFrom = PgTo

    Dim sglTime As Single


    'Debug.Print PgFrom, PgTo


    DoCmd.PrintOut acPages, PgFrom, PgTo

    Exit_prtbutton_Click:
    Exit Sub

    Err_prtbutton_Click:
    MsgBox Err.description
    Resume Exit_prtbutton_Click

    End Sub

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I would use the WHERE parameter versus the FILTER parameter in your
    DoCmd.OpenReport strDocName, acViewPreview, , strFilter

    ie.

    DoCmd.OpenReport strDocName, acViewPreview, , , strFilter (notice the extra ,)

    Not that it would matter but I have nothing but problems using the Filter parameter.

    Some things to check:
    1. The sorting/grouping to see if there's something being grouped in the report.
    2. For the report properties, change the Grid X and Grid Y values to help alignment.
    3. Check for any updated printer drivers for your printer and update. An updated printer driver can make a difference. If you're trying to use an old type of printer to do this, you may not find a solution regardless of how you setup the design. For example, trying to print on an old HP deskjet (or other older printer) may be a futile effort.
    4. Remove this: DoCmd.PrintOut acPages, PgFrom, PgTo and then test by opening the report manually (in print preview - ie. just have your button open the report in print preview) and then printing versus printing directly in code. Once you get the settings setup so it prints correctly, THEN start adding in your other code.
    5. Check the default printer for the computer.

    And get rid of the Sendkeys code. This code can often cause problems and there's a better way versus using sendkeys (I believe there are some example coding for printing in the code bank.) Also, do you really need: DoCmd****nCommand acCmdFitToWindow?

    Did you try using the report wizard (ie. Label Wizard) and try to find a label type that might be close to your paper size and then design from there? The reason I wanted you to try this is to see if you CAN design a label type report that fits on a single page with alignment.

    Also note, this:
    strDocName = "Receipt"
    strFilter = "ReceiptNo = Forms!frmrecbatch!receiptno"
    DoCmd.OpenReport strDocName, acViewPreview, , strFilter
    can easily be coded as such with 1 line of code (not that it would make a difference though):
    Docmd.openreport "Receipt",,,"[ReceiptNo] = " & Forms!frmrecbatch!receiptno & "" (for number matches)
    or
    Docmd.openreport "Receipt",,,"[ReceiptNo] = '" & Forms!frmrecbatch!receiptno & "'" (for text matches)
    Last edited by pkstormy; 04-07-10 at 20:42.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  10. #10
    Join Date
    Sep 2001
    Posts
    175
    Thanks. You have given me alot to try. Hopefully something will work. I will keep you updated.

  11. #11
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Yes. Thank you - I'm curious if you can resolve this. I've spent many hours inching fields little by little, printing, holding up the printed copy against light, and then re-doing again and again and again to finally get it to print correctly.

    Out of curiosity, what kind of printer are you using?
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  12. #12
    Join Date
    Sep 2001
    Posts
    175
    It's an Epson LQ-590 Dot Matrix printer. I use a similar printer for the invoices which work fine so I don't think it's a printer issue as I also tried printing the receipts on the invoice printer and I get the same dropping of a line or 2 when printing.

    Will let you know how things go.

    Toukey

  13. #13
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I was just curious if there might be a setting on the actual printer itself which may help but since it doesn't align correctly on either printer, it's probably the report. (I didn't think anyone used Dot Matrix printers anymore).

    I could spend a whole day playing with the settings/margins/etc.. on a report sometimes to get it to print correctly. I still think it's a matter of getting the margins set exactly.
    Last edited by pkstormy; 04-09-10 at 02:24.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  14. #14
    Join Date
    Sep 2001
    Posts
    175
    Pkstormy you were correct. It was the margins as I have finally been able to get it working correctly. Your suggestions led me to fixing this problem at last! As I was working remotely and only relying on what the user was telling me I thought it was the report all along. I was able to go to the site and actually see what was happening and correct the problem.

    Thank you so very much.
    Toukey

  15. #15
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I was curious on the solution to this. Thanks for the post toukey1!

    (you were trying to do this remotely??) Wow - that must've been fun.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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