Results 1 to 5 of 5
  1. #1
    briand26 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    2

    Box drawn with me.line on report showing in print preview but not actually printing

    I'm filling in some white space on a pretty complex Access 2010 report with some boxes drawn using the me.line method from the report's Page event.
    I've been stuck on this for a week and am starting to think it's a glitch with Access. I'm hoping someone can think of a work around.
    When I pass the starting Y coordinate as a variable (i.e. Me.Line (X1, SomeVar)-(X2,Y2), , B) the box displays in the print preview, but does not show up if sent to a printer.


    When I pass the starting Y coordinate as a literal (i.e. Me.Line (X1, 1234)-(X2,Y2), , B) the box displays in both print preview and actual print.
    Since I'm calculating the box's position on the fly it's imperative I be able to pass a variable and not just some predetermined number.
    Some things I've tried that haven't worked:

    • Changing data types (tried all numeric types (short to double) + variant)
    • Decompiled the db and recompiled.
    • Changed position, color, DrawWidth of box
    • Neither physical printers, nor pdf printers will display the box when the starting Y coordinate is passed as a variable.

    It's especially maddening because I use this same technique in the detail section to draw some boxes and they display on the print preview as well as actually print.
    This is a regulatory document and must be formatted exactly as specified. I have zero wiggle room to change the format.
    Anyone ever seen this before?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    where are you placing your code?

    Have you tried On Format event?

  3. #3
    briand26 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    2
    Quote Originally Posted by ItsMe View Post
    where are you placing your code?

    Have you tried On Format event?
    Hey ItsMe,

    I've got the code in the reports "On Page" event.

    I'm trying to draw in the white space after the detail section but before the page footer.

    As near as I can tell the report doesn't has an "On Format" event, just the individual sections (ie. page header, detail, etc.). In the detail section (where I do draw some other lines that work fine), I use the "On Print" event.

    Have you done much drawing like this? This is the first time I've use the Report.line method.

    Thanks!

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    No I have not. I know sometimes things don't always show up as you expect them to when dealing with reports. Your lines should fall somewhere in one of those sections, footer, detail, pager Header, etc.

    The on format is one of the last events looked at before printing. It may not work at all. It may be like exporting a report and something gets lost in the translation. The last ditch effort might be to try a different printer. Different printers spool different file types. You might try to export your report as a .prn and then send that to a printer.

  5. #5
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    Couple of tests -
    1 Check the value of variable after assigining to X and Y and compare them with the values which shows the boxes in preview as well as print .
    2 Try drawing a smaller box than required for testing purposes to check if the co-ordinates passed are within the range.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-20-2011, 01:34 PM
  2. Replies: 1
    Last Post: 04-21-2011, 01:58 PM
  3. Replies: 0
    Last Post: 10-11-2010, 02:40 AM
  4. Replies: 0
    Last Post: 07-15-2010, 12:13 PM
  5. Can't see sub report in print preview
    By LoggyDoggy in forum Access
    Replies: 1
    Last Post: 04-20-2010, 05:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums