PDA

Click to See Complete Forum and Search --> : Access Report Question


JackV
Jul 11th, 2000, 09:21 AM
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

Negative0
Jul 11th, 2000, 09:38 AM
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

JackV
Jul 11th, 2000, 09:45 AM
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

Negative0
Jul 11th, 2000, 09:49 AM
Check the code in the actual report, it may be on the load function of the report.

JackV
Jul 11th, 2000, 10:18 AM
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

Krass
Jan 11th, 2001, 10:02 AM
I would also be very insterested in knowing how to set margins by bode. Tell me if you find how.

Thanks.

JackV
Jan 11th, 2001, 10:06 AM
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.

Krass
Jan 11th, 2001, 10:11 AM
Can you tell me exactly where I can uncheck that 'name autocorrect' feature?

Thanks.

Krass
Jan 11th, 2001, 10:22 AM
Don't bother - I found where. I just should search before asking. I'm too lazy nowadays..

have a nice day.