Results 1 to 6 of 6
  1. #1
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Report Margins are RE-SET (2000)

    I have an database with Front end and back end data.
    If the front end is distributed to a new PC,
    the Margins in some (that is the weird bit) not all of the reports
    are RE-SET to 24.99mm from the 15.01 (I love that bug) that they are saved as.
    If they are then changed on the PC, they stay fixed,
    but as soon as the front end is copied to another PC they get RE-SET again.

    Anyone know why this is, or how to stop it?
    All reports are SET to default Printer
    All Default printers are set to A4 Paper

    I cannot crack this one.

    My only solution at the moment is the code utility below that I run after installation.

    However, this would be a real pain if I was not using the same Margins for all the reports.
    I do not want to change the default margins in Access for all PC's that use the database.

    Am I missing something here.

    RESET CODE I USE
    ================
    Private Type str_PRTMIP
    strRGB As String * 28
    End Type

    Private Type type_PRTMIP
    xLeftMargin As Long
    yTopMargin As Long
    xRightMargin As Long
    yBotMargin As Long
    fDataOnly As Long
    xWidth As Long
    yHeight As Long
    fDefaultSize As Long
    cxColumns As Long
    yColumnSpacing As Long
    xRowSpacing As Long
    rItemLayout As Long
    fFastPrint As Long
    fDatasheet As Long
    End Type

    Function ResetMargins()

    Dim dbs As DAO.Database, cnt As DAO.Container, doc As DAO.Document, rpt As Report
    Dim strRPT As String
    Dim PrtMipString As str_PRTMIP
    Dim PM As type_PRTMIP
    Const TWCM = 56.7 'mm conversion for TWIPS
    Const ML = 15 'Margin in mms

    Set dbs = CurrentDb

    Set cnt = dbs.Containers("Reports")

    For Each doc In cnt.Documents
    strRPT = doc.Name
    ' Open the report.
    DoCmd.OpenReport strRPT, acViewDesign
    Set rpt = Reports(strRPT)
    rpt.Visible = False
    'Get Printer Settings
    PrtMipString.strRGB = rpt.PrtMip
    LSet PM = PrtMipString

    ' Set margins.
    PM.xLeftMargin = TWCM * ML
    PM.yTopMargin = TWCM * ML
    PM.xRightMargin = TWCM * ML
    PM.yBotMargin = TWCM * ML

    ' Update property.
    LSet PrtMipString = PM
    rpt.PrtMip = PrtMipString.strRGB
    DoCmd.Close acReport, strRPT, acSaveYes
    Set rpt = Nothing
    Next


    Set rpt = Nothing
    Set doc = Nothing
    Set cnt = Nothing
    Set dbs = Nothing

    MsgBox "All Reports Margins re-set to " & ML & "mm", vbInformation

    Exit Function

    UpdateReportMarginError:

    MsgBox "Error Updating Margins in report " & vbLf & strRPT & vbLf & Err.Number & vbLf & Err.Description, vbCritical
    Set rpt = Nothing
    Set doc = Nothing
    Set cnt = Nothing
    Set dbs = Nothing

    Exit Function

    End Function



    Thanks for any help.

    Andrew
    Andrew

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Report Margins are RE-SET (2000)

    This problem went away for me once I installed SP1 for Access 2000, but I think others have reported that simply turning off Track Name Autocorrect was enough to fix it.
    Regards
    John



  3. #3
    4 Star Lounger
    Join Date
    Dec 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Margins are RE-SET (2000)

    I can't give an opinion on John's advice as I hadn't heard about TrackName AutoCorrect as affecting printers settings (I'm anxious to try this out!), but my experience has been that unless you set any report to Use Specific Printer it will invariably revert to the printer settings that are on the General Tab of the Tools/Options Menu item. This seems to always happen whenever a different printer is selected from the one in which the margins were originally set.

    As I understand it, this is a bug in Access 2000. My solution is to use the Use Specific Printer option in Page Setup for every report that I don't want to use default settings for. In your case, you could just go and reset the default marding in the in the Tools/Options menu since you are using the same margins all the time.

    Peter N

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Report Margins are RE-SET (2000)

    Name AutoCorrect was known for causing this problem in Access 2000, among other problems. In fact, saving a report for a specific printer causes the settings to go back to the default if that printer is not available on a given machine, which is why using the default printer is recommended. I don't recall which service release of Office 2000 was supposed to fix the printer settings problem, but I would recommend installing the latest one for a variety of patches.
    Charlotte

  5. #5
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Report Margins are RE-SET (2000)

    I am only replying to one, but thanks to all.
    I will check the SP's to make sure and also turn off the Name Autocorrect to see if it happens.
    I have to use Default printer because it varies from machine to machine.
    Anyway, I have written a utility to change the Margins.
    Indeed, by putting the margin size in the Tag property of the report
    I can get my utility to change them to a specific size if needed now.

    Thanks to all
    Andrew

  6. #6
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Margins are RE-SET (2000)

    For info it was SP1 that fixed this problem.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

Posting Permissions

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