Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print Margins? (XP)

    Is there a macro I can use to set default print margins for a report?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

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

    Re: Print Margins? (XP)

    I don't think you can set the default margins for a report, except by creating a report with the desired settings and making it the template for new reports (in the Form/Report tab of Tools | Options...)

    You can also set the margins for a report in VBA. The Printer property of a Report has LeftMargin, TopMargin, RightMargin and BottomMargin properties. They are measured in twips, where 1 inch = 1440 twips. Example:

    Reports("MyReport").Printer.LeftMargin = 720

    This sets the left margin to 1/2 inch.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print Margins? (XP)

    Thanks Hans, now where do I put that code? In a module? And where the heck do they come up with these measurements?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

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

    Re: Print Margins? (XP)

    I don't know when and where you want to call this code.

    Windows uses twips for most measurements. There are 20 twips in 1 point, and 72 points in one inch. A point is a traditional unit used by (book) printers.

  5. #5
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print Margins? (XP)

    Try to learn something new every day, huh? I want to call this code when the report is opened in print preview....
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

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

    Re: Print Margins? (XP)

    Why don't you set the margins in design view? Much easier than using code.

  7. #7
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print Margins? (XP)

    Don't they reset on each machine I load the Front End on?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

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

    Re: Print Margins? (XP)

    A report should remember its margins, even when the database is copied to another PC. Name AutoCorrect reputedly causes reports to lose their page settings, so it is a good idea to turn it off in the General tab of Tools | Options... Unfortunately, you will have to do this in each database; the default setting is "on".

    There is one exception: if you design a report while a laser printer is the default printer, then transfer the database to a machine where an inkjet printer is the default printer, the bottom margin may change, because inkjet printers have a much larger bottom margin than laser printers.

    Setting the page margins in the On Open event of the report doesn't have the desired effect, at least not immediately.

  9. #9
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print Margins? (XP)

    What about OnLoad? Thanks for the different options....so if I just copy/paste a dbase front end on each computer, autocomplete will always by default be 'on'?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

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

    Re: Print Margins? (XP)

    a) A report doesn't have an On Load event, that is for forms.

    [img]/forums/images/smilies/cool.gif[/img] If you copy an existing database, the Track Name AutoCorrect options will be preserved, so you don't have to worry about that. But each time you create a new database, Track Name AutoCorrect will be on.

Posting Permissions

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