Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    65

    Unanswered: Printer skips pages when printing reports

    Hi!

    I created a VBA procedure that reads an Access Table, groups data using a field, and then prints a report for that group. All in all, there's a maximum of 37 printed reports that will be generated. It also generates an excel file for each of the groups. The problem: when printed, it skips some of the reports and prints some twice. At first, I thought its the way I coded it but I found out that my excel files from each of the groups are all correct. Nothing is missing. So what do you think is the problem? I tried putting a timer in between the Docmd's that print and exports it into a file but it still skips.

  2. #2
    Join Date
    Dec 2002
    Posts
    97

    Ideas...

    As one solution instead of just writing a series of doCmds you might want to create a sub routine that can be called and have the report values passed to it.

    To debug it a bit more you could try adding a msgBox to let you know when each print command is being generated that way you can track if the report is actually being sent or not.

    Hope it helps.
    -C

  3. #3
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    65
    Can I remove the timers/delays between print commands if I implement your suggestions?

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i didn't see this with XLS but then i never tried 37 exports in series.

    something similar happens with msgraph and multi-reports so maybe a similar fix works... get rid of your timer and call toOS between each report.

    private sub toOS()
    dim delays as integer
    for delays = 1 to 5000 'adjust down until it breaks, then back off some
    doevents 'relinquish control to the operating system
    loop
    end sub

    also, if you have a whole bunch of nested queries or messy calculations going into your reports, consider making a temporary table from the final result (or as near final as you can get if you have report calcs) and base your report on the temp table.

    again, these are msgraph fixes, but maybe they apply.
    my application doing 50 .SNP reports with 9 graphs each and running from 9 temporary tables works fine with 5 doevents at the beginning of the year. by year end when i've got 10000 rows i'm running 100 doevents between each report. i made the number of doevents user settable on the report-menu but i guess i should make it a function of rowcount one of these days.

    izy
    currently using SS 2008R2

  5. #5
    Join Date
    Oct 2003
    Location
    Boston, Mass. USA
    Posts
    81
    check to make sure your report did not get accidentally set to be wider than the paper is (or taller). An accidental mouse drag that puts your report at 8.505 inches wide instead of 8.5 inches wide may print some blank page or pages (how many depending on orientation, column settings etc.)

    Also, are all of your reports going to the same printer? Is anything being printed from that pc by another application to another printer while this runs, or is anything being printed to that printer from somewhere else while your 37 reports are printing. We have one of those big copier/printer combination machines for high volume use. For some reason in one particular version of windows the driver for Access 2000 for that printer does not work after you print to any other machine (including to PDF), and we had to install the driver for Access 97 to get it to work right. This created a little bit of office politics because the fix is so unorthodox it had to be done on the sly, but it is the only way to make it work.

    You could try printing everything to the same printer and not let anyone else use the printer or simiiar things as a text.

Posting Permissions

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