473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 6414
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
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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,...

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.