A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Dynamic Page Margins



 
 
Thread Tools Display Modes
  #1  
Old September 16th, 2004, 08:54 PM
Vel
external usenet poster
 
Posts: n/a
Default Dynamic Page Margins

Hello,

I have a report which must print out on a paper form.
However, occasionally the forms are cut just a bit
differently, causing me to need to 'nudge' the text a
hair to the right, left, up, or down. I would like to be
able to print an alignment of the report and then, if
necessary, enter into a dialog box or a form a number of
points, positive or negative, to add or subtract from the
default margins. Is there a property on the form which
can be dynamically altered to do this?

Thanks,

Vel.
  #2  
Old September 16th, 2004, 09:39 PM
fredg
external usenet poster
 
Posts: n/a
Default

On Thu, 16 Sep 2004 12:54:33 -0700, Vel wrote:

Hello,

I have a report which must print out on a paper form.
However, occasionally the forms are cut just a bit
differently, causing me to need to 'nudge' the text a
hair to the right, left, up, or down. I would like to be
able to print an alignment of the report and then, if
necessary, enter into a dialog box or a form a number of
points, positive or negative, to add or subtract from the
default margins. Is there a property on the form which
can be dynamically altered to do this?

Thanks,

Vel.


You can use the PrtMip property to change margins, etc. of a report.
But you must open the report in Design View (you can use code) to do
so.

Look up the PrtMip property in VBA help.
The second example show how to change margins.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #3  
Old September 17th, 2004, 05:59 AM
Marshall Barton
external usenet poster
 
Posts: n/a
Default

Vel wrote:
I have a report which must print out on a paper form.
However, occasionally the forms are cut just a bit
differently, causing me to need to 'nudge' the text a
hair to the right, left, up, or down. I would like to be
able to print an alignment of the report and then, if
necessary, enter into a dialog box or a form a number of
points, positive or negative, to add or subtract from the
default margins. Is there a property on the form which
can be dynamically altered to do this?



Form? You're not trying to print a form are you??

Reports (and form) objects in A2002 and later have a Printer
Property. The returned object has many properties including
the four margins. See Help for details.

--
Marsh
MVP [MS Access]
  #4  
Old September 17th, 2004, 07:23 PM
Vel.
external usenet poster
 
Posts: n/a
Default

Alright, I managed to get the margins to change dynamically like I wanted,
but I still have a minor problem. How do I close the design view using code.
I'm sure it's a simple matter, but I've never had to have anything open in
design view for user functionality before so it's never come up. The
Docmd.Close command just closes the form open in preview mode, not design
view, so...

Thanks Again

"Vel" wrote:

Hello,

I have a report which must print out on a paper form.
However, occasionally the forms are cut just a bit
differently, causing me to need to 'nudge' the text a
hair to the right, left, up, or down. I would like to be
able to print an alignment of the report and then, if
necessary, enter into a dialog box or a form a number of
points, positive or negative, to add or subtract from the
default margins. Is there a property on the form which
can be dynamically altered to do this?

Thanks,

Vel.

  #5  
Old September 17th, 2004, 07:46 PM
fredg
external usenet poster
 
Posts: n/a
Default

On Fri, 17 Sep 2004 11:23:03 -0700, Vel. wrote:

Alright, I managed to get the margins to change dynamically like I wanted,
but I still have a minor problem. How do I close the design view using code.
I'm sure it's a simple matter, but I've never had to have anything open in
design view for user functionality before so it's never come up. The
Docmd.Close command just closes the form open in preview mode, not design
view, so...

Thanks Again

"Vel" wrote:

Hello,

I have a report which must print out on a paper form.
However, occasionally the forms are cut just a bit
differently, causing me to need to 'nudge' the text a
hair to the right, left, up, or down. I would like to be
able to print an alignment of the report and then, if
necessary, enter into a dialog box or a form a number of
points, positive or negative, to add or subtract from the
default margins. Is there a property on the form which
can be dynamically altered to do this?

Thanks,

Vel.


The Docmd.Close command just closes the form open in preview
mode, not design view, so...

Not so.
DoCmd.Close has arguments. It will close whatever you tell it to.

Just close the report, and save as acSaveYes to avoid a prompt.

DoCmd.Close acReport, "ReportName", acSaveYes
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #6  
Old September 18th, 2004, 12:23 PM
Vel.
external usenet poster
 
Posts: n/a
Default

What event should I put that code in? Here's how I have it set up. Upon
clicking the 'print' button on my form.

1 The form becomes invisible (allowing the fields on the form to still be
used as
parameters to send to various bits of the report)
2 The report opens in design view and the margins are modified.
3 The report opens in print preview mode to allow the user to check the
data prior
to printing.
4 When the report is printed a dialog box pops up asking if it printed
correctly (if so
then some fields in the table are updated, if not they are not).
5 When the report closes the original form reopens.
--The report is still open in design view in the background.--

Vel.

p.s. I assume I want to do:

docmd.Close, acReport, stName, acSaveNo if I want to preserve the default
margins, where stName is the name of the open report.

I just don't know where to place that line of code. It won't let me put it
in the report's OnClose event, and it didn't seem to fire on the form's
OnActivate.


"fredg" wrote:

On Fri, 17 Sep 2004 11:23:03 -0700, Vel. wrote:

Alright, I managed to get the margins to change dynamically like I wanted,
but I still have a minor problem. How do I close the design view using code.
I'm sure it's a simple matter, but I've never had to have anything open in
design view for user functionality before so it's never come up. The
Docmd.Close command just closes the form open in preview mode, not design
view, so...

Thanks Again

"Vel" wrote:

Hello,

I have a report which must print out on a paper form.
However, occasionally the forms are cut just a bit
differently, causing me to need to 'nudge' the text a
hair to the right, left, up, or down. I would like to be
able to print an alignment of the report and then, if
necessary, enter into a dialog box or a form a number of
points, positive or negative, to add or subtract from the
default margins. Is there a property on the form which
can be dynamically altered to do this?

Thanks,

Vel.


The Docmd.Close command just closes the form open in preview
mode, not design view, so...

Not so.
DoCmd.Close has arguments. It will close whatever you tell it to.

Just close the report, and save as acSaveYes to avoid a prompt.

DoCmd.Close acReport, "ReportName", acSaveYes
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

  #7  
Old September 19th, 2004, 09:46 PM
fredg
external usenet poster
 
Posts: n/a
Default

On Sat, 18 Sep 2004 04:23:02 -0700, Vel. wrote:

What event should I put that code in? Here's how I have it set up. Upon
clicking the 'print' button on my form.

1 The form becomes invisible (allowing the fields on the form to still be
used as
parameters to send to various bits of the report)
2 The report opens in design view and the margins are modified.
3 The report opens in print preview mode to allow the user to check the
data prior
to printing.
4 When the report is printed a dialog box pops up asking if it printed
correctly (if so
then some fields in the table are updated, if not they are not).
5 When the report closes the original form reopens.
--The report is still open in design view in the background.--

Vel.

p.s. I assume I want to do:

docmd.Close, acReport, stName, acSaveNo if I want to preserve the default
margins, where stName is the name of the open report.

I just don't know where to place that line of code. It won't let me put it
in the report's OnClose event, and it didn't seem to fire on the form's
OnActivate.

"fredg" wrote:

On Fri, 17 Sep 2004 11:23:03 -0700, Vel. wrote:

Alright, I managed to get the margins to change dynamically like I wanted,
but I still have a minor problem. How do I close the design view using code.
I'm sure it's a simple matter, but I've never had to have anything open in
design view for user functionality before so it's never come up. The
Docmd.Close command just closes the form open in preview mode, not design
view, so...

Thanks Again

"Vel" wrote:

Hello,

I have a report which must print out on a paper form.
However, occasionally the forms are cut just a bit
differently, causing me to need to 'nudge' the text a
hair to the right, left, up, or down. I would like to be
able to print an alignment of the report and then, if
necessary, enter into a dialog box or a form a number of
points, positive or negative, to add or subtract from the
default margins. Is there a property on the form which
can be dynamically altered to do this?

Thanks,

Vel.


The Docmd.Close command just closes the form open in preview
mode, not design view, so...

Not so.
DoCmd.Close has arguments. It will close whatever you tell it to.

Just close the report, and save as acSaveYes to avoid a prompt.

DoCmd.Close acReport, "ReportName", acSaveYes
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.



1 The form becomes invisible (allowing the fields on the form to
still be
used as
parameters to send to various bits of the report)
2 The report opens in design view and the margins are modified.
3 The report opens in print preview mode to allow the user to check the
data prior
to printing.
4 When the report is printed a dialog box pops up asking if it printed
correctly (if so
then some fields in the table are updated, if not they are not).
5 When the report closes the original form reopens.
--The report is still open in design view in the background.--


1) The first thing you need to do is open the report in design view.
2) Make the setup changes you want.
3) Close the report and save the changes.
4) Open the report, this time in preview.
5) Hide the form
6) When the report is printed a dialog box pops up asking if it
printed correctly (if so then some fields in the table are updated,
if not they are not).
7) Close the report.
8) Close the form (or make it visible again)

Item # 1 to 5 is done from the Form button's Click event you are using
to open the report.
DoCmd.OpenReport "ReportName", acViewDesign, , , acHidden
' Make your report changes here
DoCmd.Close acReport, "ReportName", acSaveYes
DoCmd.OpenReport "ReportName", acViewPreview
Me.Visible = False

Item # 6 is done by some event in the report or somewhere else. I have
no idea how you are doing this or what.

Item # 7 is done automatically when you print the report, or manually,
if you preview the report, by clicking the 'Close' toolbutton on the
Print Preview tool bar.

Item #8 should be done in the Report's Close event.
DoCmd.Close acForm, "FormName"
Or.. instead of closing the form if you wish to make it visible again,
use:
forms!FormName.Visible = True

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set the page margins on a report: Irshad Alam Setting Up & Running Reports 0 August 23rd, 2004 02:00 PM
Label SRIT General Discussion 2 June 22nd, 2004 09:42 PM
Omit Page # on first page JethroUK© New Users 16 June 17th, 2004 09:20 PM
odd page section breaks Bill Mitchell Formatting Long Documents 6 June 17th, 2004 02:20 PM
anchored textbox moves when text goes to Page 2 octavee Page Layout 5 May 27th, 2004 02:40 AM


All times are GMT +1. The time now is 04:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.