By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,255 Members | 2,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,255 IT Pros & Developers. It's quick & easy.

Print Margin Problem in Reports

tdw
100+
P: 206
Hi,

I have searched for this answer to no avail. I've found some very similar questions, but no answers that seem to apply.

Here's the deal: All reports work fine on my computer. My boss, however, can't get reports to print correctly from his. What is happening is that his page margins in the 'page setup' keep resetting to include over 7" on the right, thus only allowing a narrow sliver on the left side of the page to print, thus, in turn, causing a one page report to turn into over 30 pages of tiny bits.

I tried correcting the margins, and they stay put, until....

At this point I should explain how the database opens:

1. It is a Front-end Back-end database. The back-end is on the server, front-end on each user's computer.

2. Often I make updates and improvements to the design of the forms and reports in the front-end, and then save the changes to a copy of the front-end, which also resides on the server.

3. Each user has an icon on their desktop which launches a .bat file which copies the front-end database file from the server onto the user's computer, and then it opens that newly copied front-end database file on their computer. This way, every time someone opens the database, they are sure to have the latest changes and improvements.

Now back to the print margin issue:

On my boss's computer, after I have adjusted the margins using the report's page setup, they stay fixed as long as the database remains open. They ALSO stay fixed if I close the database, but then re-open it directly from the front-end file on his computer (skipping the .bat file). However, if I open it the normal way, using the .bat file icon (meaning that the copy on the server copies over to his computer and then opens), now suddenly his margins are all screwed up again.

I have tested it and tested it, and it does that on his computer every time, and never on mine! Mine opens using the same process as his.

Help!

Thanks ahead of time
Jun 4 '08 #1
Share this Question
Share on Google+
8 Replies


Expert 100+
P: 344
I think this is related to another question I answered yesterday about 'currency' format. How does 'Currency' format relate to print margins you say!

When you specify 'Currency', Access does not store currency, it stores whatever currency format you have on your PC at the time.

I bet that when you set up your report and give it say, 1cm margin, it does not store 1cm margin, it looks at your print driver and works out what code to send based on that driver.

Go to a different PC, with a different print driver, and the margins will change.

This is just a guess, I can't test it here but check out your boss's PC has the same print driver as you. If not, see if you can make them the same and see if that solves your problem
Jun 5 '08 #2

ADezii
Expert 5K+
P: 8,638
I haven't actually tried this, but how about pro-grammatically changing the Left and Right Margins for your Report, then Print and Close it? The code should be:
Expand|Select|Wrap|Line Numbers
  1. 'Programmatically change the Left and Right Margins
  2. Const conTwipsPerInch As Long = 1440
  3. Const conReport As String = "<Your Report Name>"
  4.  
  5. DoCmd.OpenReport conReport, View:=acViewPreview, WindowMode:=acHidden
  6.  
  7. With Reports(conReport).Printer
  8.   .LeftMargin = 1 * conTwipsPerInch         '1" Left Margin
  9.   .RightMargin = 0.5 * conTwipsPerInch      '1/2" Right Margin
  10. End With
  11.  
  12. DoCmd.OpenReport conReport, acViewNormal
  13. DoCmd.Close acReport, conReport
Jun 6 '08 #3

tdw
100+
P: 206
tdw
I haven't actually tried this, but how about pro-grammatically changing the Left and Right Margins for your Report, then Print and Close it? The code should be:
Expand|Select|Wrap|Line Numbers
  1. 'Programmatically change the Left and Right Margins
  2. Const conTwipsPerInch As Long = 1440
  3. Const conReport As String = "<Your Report Name>"
  4.  
  5. DoCmd.OpenReport conReport, View:=acViewPreview, WindowMode:=acHidden
  6.  
  7. With Reports(conReport).Printer
  8.   .LeftMargin = 1 * conTwipsPerInch         '1" Left Margin
  9.   .RightMargin = 0.5 * conTwipsPerInch      '1/2" Right Margin
  10. End With
  11.  
  12. DoCmd.OpenReport conReport, acViewNormal
  13. DoCmd.Close acReport, conReport
Thanks, I will try that and let you know. Currently I'm using a macro, but if I understand this correctly, this code would take the place of that macro.

In response to Lysander, yes the same print drivers are on all computers. In fact, my boss's computer does exactly the same thing no matter which of our several printers is used. I tried changing his default printer to each of them, and it didn't change anything. So it's definitely something about his computer (or his copy of Access?).
Jun 6 '08 #4

ADezii
Expert 5K+
P: 8,638
Thanks, I will try that and let you know. Currently I'm using a macro, but if I understand this correctly, this code would take the place of that macro.

In response to Lysander, yes the same print drivers are on all computers. In fact, my boss's computer does exactly the same thing no matter which of our several printers is used. I tried changing his default printer to each of them, and it didn't change anything. So it's definitely something about his computer (or his copy of Access?).
Thanks, I will try that and let you know. Currently I'm using a macro, but if I understand this correctly, this code would take the place of that macro.
Yes it would, your current Macro will be replaced by this code.
Jun 6 '08 #5

tdw
100+
P: 206
tdw
Yes it would, your current Macro will be replaced by this code.
This is really weird. I made the changes, and the changes work perfectly well, except for on my boss's computer!! His computer still does exactly the same thing! He has no trouble with printing from any other program.

Here's an example of what it does.

Let's use this paragraph as the example. Obviously the report is more than just a paragraph of text, but hopefully you'll see what I'm trying to demonstrate. Instead of printing the report as a whole, it prints in pieces. So if this paragraph were the form it would be like this:

page 1

Let's use this

page 2

paragraph as the

page 3

example. Obviously

page 4

the report is more

page 5

than just

etc etc etc until finally the whole thing has printed in pieces (around 30 pages, when the report should have all been on one page).
Jun 7 '08 #6

tdw
100+
P: 206
tdw
This is really weird. I made the changes, and the changes work perfectly well, except for on my boss's computer!! His computer still does exactly the same thing! He has no trouble with printing from any other program.

Here's an example of what it does.

Let's use this paragraph as the example. Obviously the report is more than just a paragraph of text, but hopefully you'll see what I'm trying to demonstrate. Instead of printing the report as a whole, it prints in pieces. So if this paragraph were the form it would be like this:

page 1

Let's use this

page 2

paragraph as the

page 3

example. Obviously

page 4

the report is more

page 5

than just

etc etc etc until finally the whole thing has printed in pieces (around 30 pages, when the report should have all been on one page).
bump bump bump bump bump :-)
Jun 12 '08 #7

P: 78
2 questions. These both pertain to the Access Options menu.

Under the General Tab is the Track auto name corrections checked? If so It shouldnt be. That will keep the Margins from defaulting to the PC's and will maintain the DB's margin settings.

Secondly, under the same tab do the margins's show the way you would want them to.

I found that this was a problem with my reporting. I would set the margins and the view (landscape or portrait) when designing and save it. But as soon as I close access and reopen it I would lose what I did.

A way that I used to ensure this wouldnt happen on a nother PC was to use a line of code in the swtichboard load option (or whatever form appears when the program is opened). I will place it below in case you want to try it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.  
  3.     Application.SetOption "Left Margin", 0.5
  4.     Application.SetOption "Right Margin", 0.5
  5.     Application.SetOption "Top Margin", 0.5
  6.     Application.SetOption "Bottom Margin", 0.5
  7.     Application.SetOption "Track Name AutoCorrect Info", False
  8.  
  9. End Sub
  10.  
I hope this is helpful

Nick
Jun 12 '08 #8

tdw
100+
P: 206
tdw
2 questions. These both pertain to the Access Options menu.

Under the General Tab is the Track auto name corrections checked? If so It shouldnt be. That will keep the Margins from defaulting to the PC's and will maintain the DB's margin settings.

Secondly, under the same tab do the margins's show the way you would want them to.

I found that this was a problem with my reporting. I would set the margins and the view (landscape or portrait) when designing and save it. But as soon as I close access and reopen it I would lose what I did.

A way that I used to ensure this wouldnt happen on a nother PC was to use a line of code in the swtichboard load option (or whatever form appears when the program is opened). I will place it below in case you want to try it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.  
  3.     Application.SetOption "Left Margin", 0.5
  4.     Application.SetOption "Right Margin", 0.5
  5.     Application.SetOption "Top Margin", 0.5
  6.     Application.SetOption "Bottom Margin", 0.5
  7.     Application.SetOption "Track Name AutoCorrect Info", False
  8.  
  9. End Sub
  10.  
I hope this is helpful

Nick
box is unchecked and margins are set right in that tab.

I tried similar code in the button that launches the report, but I will try it on the switchboard. Thanks!
Jun 12 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.