473,503 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how do I set "gutter" margins?

Jan
Hi:

I was so sure this was easy that I left it for the last minute and now
I'm stuck. I'm working on the student directory for my kids' school and
since it will be printed on 3-hole punch paper, we need the margins to
switch: big left margin on the even-numbered pages, big right margin on
the odd-numbered pages. But I can't for the life of me figure out how
to set this up, programmatically or otherwise. I searched the archives,
etc. and saw references to prtmip, but the examples don't seem to fit
what I'm doing and frankly I find them really hard to understand regardless.

Anyone have any thoughts, before I have to reformat the whole thing with
1-inch margins all around?

Thanks.

Jan
Sep 16 '07 #1
7 6425
Access does not give you gutter margins like Word does, so you have to use
code in the Format event of the Page Header to move all the controls over to
the right if the page number is even.

This example moves the controls half an inch to the right. (Measurements are
in twips, where 1440 twips = 1 inch.) Be sure to set up the page so there is
nothing in the rightmost half inch.

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim ctl As Control
Dim iGutter As Integer

'Use half an inch gutter on the even pages.
If (Me.Page Mod 2) = 0 Then
iGutter = 720
End If

For Each ctl In Me.Controls
If IsNumeric(ctl.Tag) Then
ctl.Left = CInt(ctl.Tag) + iGutter
End If
Next
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jan" <ja*@dontspamme.comwrote in message
news:13*************@corp.supernews.com...
>
I was so sure this was easy that I left it for the last minute and now I'm
stuck. I'm working on the student directory for my kids' school and since
it will be printed on 3-hole punch paper, we need the margins to switch:
big left margin on the even-numbered pages, big right margin on the
odd-numbered pages. But I can't for the life of me figure out how to set
this up, programmatically or otherwise. I searched the archives, etc. and
saw references to prtmip, but the examples don't seem to fit what I'm
doing and frankly I find them really hard to understand regardless.

Anyone have any thoughts, before I have to reformat the whole thing with
1-inch margins all around?

Thanks.

Jan
Sep 16 '07 #2
Jan
Hi, Allen:

Thanks so much; I was hoping someone would have a quick answer.

One question: looks like you're setting the tag of each control to be
the original left position of the control. Is there a reason for not
just saying
ctl.left=ctl.left+gutter

Thanks.

Jan

Allen Browne wrote:
Access does not give you gutter margins like Word does, so you have to
use code in the Format event of the Page Header to move all the controls
over to the right if the page number is even.

This example moves the controls half an inch to the right. (Measurements
are in twips, where 1440 twips = 1 inch.) Be sure to set up the page so
there is nothing in the rightmost half inch.

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim ctl As Control
Dim iGutter As Integer

'Use half an inch gutter on the even pages.
If (Me.Page Mod 2) = 0 Then
iGutter = 720
End If

For Each ctl In Me.Controls
If IsNumeric(ctl.Tag) Then
ctl.Left = CInt(ctl.Tag) + iGutter
End If
Next
End Sub
Sep 16 '07 #3
Jan
OK, I've been working with this for a while now and I've hit another hitch.

(I understand, btw, why I have to put the left margin in the tag;
otherwise the controls continue to march across the page till they fall
off the right side!)

But the problem now is that this particular report is set up in columns,
and while my controls are shifting nicely from side to side, my column
placements seem not to be moving. In particular, the "space between
columns" seems to be in a fixed spot, so on the "big-left-margin" pages
(where all the controls are shifted right), the columns are forced
narrower because the cut-off seems to be fixed. Does that make any sense?

Any ideas?

Jan

Allen Browne wrote:
Access does not give you gutter margins like Word does, so you have
to use code in the Format event of the Page Header to move all the
controls over to the right if the page number is even.

This example moves the controls half an inch to the right.
(Measurements are in twips, where 1440 twips = 1 inch.) Be sure to
set up the page so there is nothing in the rightmost half inch.

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount
As Integer) Dim ctl As Control Dim iGutter As Integer

'Use half an inch gutter on the even pages. If (Me.Page Mod 2) = 0
Then iGutter = 720 End If

For Each ctl In Me.Controls If IsNumeric(ctl.Tag) Then ctl.Left =
CInt(ctl.Tag) + iGutter End If Next End Sub
Sep 16 '07 #4
Yes: this is less than ideal for a page with multiple columns.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jan" <ja*@dontspamme.comwrote in message
news:13*************@corp.supernews.com...
OK, I've been working with this for a while now and I've hit another
hitch.

(I understand, btw, why I have to put the left margin in the tag;
otherwise the controls continue to march across the page till they fall
off the right side!)

But the problem now is that this particular report is set up in columns,
and while my controls are shifting nicely from side to side, my column
placements seem not to be moving. In particular, the "space between
columns" seems to be in a fixed spot, so on the "big-left-margin" pages
(where all the controls are shifted right), the columns are forced
narrower because the cut-off seems to be fixed. Does that make any sense?

Any ideas?

Jan

Allen Browne wrote:
>Access does not give you gutter margins like Word does, so you have
to use code in the Format event of the Page Header to move all the
controls over to the right if the page number is even.

This example moves the controls half an inch to the right.
(Measurements are in twips, where 1440 twips = 1 inch.) Be sure to
set up the page so there is nothing in the rightmost half inch.

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount
As Integer) Dim ctl As Control Dim iGutter As Integer

'Use half an inch gutter on the even pages. If (Me.Page Mod 2) = 0
Then iGutter = 720 End If

For Each ctl In Me.Controls If IsNumeric(ctl.Tag) Then ctl.Left =
CInt(ctl.Tag) + iGutter End If Next End Sub
Sep 16 '07 #5
Jan
Any solutions to that problem? I do have a fallback option but it's not
so great graphically.

Allen Browne wrote:
Yes: this is less than ideal for a page with multiple columns.
Sep 16 '07 #6
Jan wrote:
Any solutions to that problem? I do have a fallback option but it's not
so great graphically.
Unfortunately a report writer is not a word processor.

If you had data in row/columns in Excel, could you create a report like
you want? If so, maybe you can create a query a Word Doc could use for
the source or export it to Excel.

Allen Browne wrote:
>Yes: this is less than ideal for a page with multiple columns.
Sep 16 '07 #7
Jan
Yeah, well, it's pretty last minute at this point (they want to print
the directory tomorrow) and so I'm just going to use my fallback option.
This is one of those volunteer projects that is way bigger than it
should be, and there are times when I just have to call it quits.

Thanks Salad and Allen for your help; I've gotten 90% there and it's
just going to have to be good enough.

Jan

Salad wrote:
Jan wrote:
>Any solutions to that problem? I do have a fallback option but
it's not so great graphically.
Unfortunately a report writer is not a word processor.

If you had data in row/columns in Excel, could you create a report
like you want? If so, maybe you can create a query a Word Doc could
use for the source or export it to Excel.

>Allen Browne wrote:
>>Yes: this is less than ideal for a page with multiple columns.
Sep 16 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3714
by: Frances Del Rio | last post by:
when I test my stuff with the validator in HomeSite it tells me the body tag no longer reads margin attributes.. does this mean now margins are to be specified only in CSS? I work for an...
27
3128
by: Thomas Mlynarczyk | last post by:
Hello, I noticed that IE seems to put some kind of default margins on <li> elements and the only way to get rid of them seems to be asigning negative margins. To make things worse, IE5 and IE6...
1
2204
by: Maurice Mertens | last post by:
Hello, I'm trying to print a report to the printer but somehow it doesn't take the margins I set. I want the report to have a margin of 0.7 cm (397 twips), so in code I use the following: ...
5
1885
by: Borris | last post by:
<div style="background-color: blue; width: 500px; height: 300px"> <div style="background-color: red; margin-top: 100px; margin-left: 100px; width: 300px; height: 100px"> </div> </div> Where...
8
9585
by: Tinus | last post by:
Hello all, Because you have been so helpfull the last couple of times, I thought after testing and wasting more than 20 pages (and google-ling for 3 days :-( ). I would ask you again for your...
7
2739
by: tm | last post by:
I am trying to print a form using the following code, everything works fine but the margins are not acted upon. What I am I doing wrong? Private Sub CaptureScreen() Dim myGraphics As...
0
1369
by: Todd | last post by:
Hi guys, Strange bug if someone could help. ... Im using printDialog, printDocument and printPreviewDialog to write my print routines for a graphics application. I want to allow the user to...
1
2815
by: scrawnyguns | last post by:
There's probably something easy I'm missing here. When I run a print operation in my program (Microsoft VB.Net Form) I have some code that sets the print margins so that it leaves a nice gap,...
5
11115
by: Anne DeBlois | last post by:
Hi, We are developing a database application in Visual Basic.NET 2005. The application will print label pages. Using the PrintDocument and GDI+ classes, I noticed a slight change when printing...
7
20670
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.