Results 1 to 9 of 9

Thread: Access Report Question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    80

    Unhappy

    I have an Access DB that when one of the reports is opened the margins that are in page setup always default to 1" even after I change and then save.

    If I open the report in design view and set the margins in page setup then, the margins will be okay the next time I run it. However the time after that they reset back to 1".

    The DB was created with the various Access wizards. The report is opened via a click event with the Docmd.Openreport method and it has an SQL statement in it's filter property.

    All the other reports work fine once the margtins are set, though their data is more static as the report that is having the trouble is the invoice report of the application. Thanks in advance.

    -Jack Vinitsky

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Check to see if the margins are hard coded in the program. They may be set somewhere in the code by the wizard.

    Hope this helps

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    80
    Here is the code that opens it:

    If Forms![Workorders by Customer]![Workorders by Customer Subform].Form.RecordsetClone.RecordCount = 0 Then
    MsgBox "There is no data for this report. Canceling report..."
    Else
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    DoCmd.OpenReport "Invoice", acPreview
    End If

    Also in the report open event, there is code that opens a form as a dialog that previews a few of the fields that are in the report that is to be displayed.

    -Jack Vinitsky

  4. #4
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Check the code in the actual report, it may be on the load function of the report.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    80
    I checked and there is no code that references any margins in any of the report events.

    I put a DoCmd.Save in the report_save in the report close event. That preserves any margin changes to any old invoices. However when I type a new invoice it still defaults to 1" margins.

    How would I reference the page setup margins? Perhaps I can put that in the report_open event?

    -Jack Vinitsky

  6. #6
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489
    I would also be very insterested in knowing how to set margins by bode. Tell me if you find how.

    Thanks.
    Chris

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    80
    Wow I forgot all about this post.

    It turned out the problem was due to a bug in Access 2000 with the name autocorrect feature. Unchecking it fixed the problem. I believe the bug was fixed in SP1.

  8. #8
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489
    Can you tell me exactly where I can uncheck that 'name autocorrect' feature?

    Thanks.
    Chris

  9. #9
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489
    Don't bother - I found where. I just should search before asking. I'm too lazy nowadays..

    have a nice day.
    Chris

Posting Permissions

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



Click Here to Expand Forum to Full Width