473,840 Members | 1,640 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, programmaticall y 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 6499
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 PageHeaderSecti on_Format(Cance l 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.T ag) 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.supe rnews.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, programmaticall y 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.le ft+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 PageHeaderSecti on_Format(Cance l 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.T ag) 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 PageHeaderSecti on_Format(Cance l 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.T ag) 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.supe rnews.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.
(Measurement s 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 PageHeaderSecti on_Format(Cance l 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.T ag) 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
3740
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 internet co., they support IE 5+ and the old pre-6 Netscape.. if you don't put this tag in html docs, what version of HTML does it default to? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
27
3169
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 seem to have different defaults. Is there an elegant way to remove these stupid margins? Greetings, Thomas
1
2236
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: dim rpt as New rptOverview
5
1900
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 will the red box be positioned? Even experienced web developers often expect it to be in the middle of the blue box, but instead (on standards-compliant browsers) the blue box is lowered to line up its top edge with that of the red box. This is...
8
9657
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 help. The problem is this: If I print a rectangle which begins at (0,0) and the margins are also set to 0 (l:0, t:0, r:0, b:0) then it prints fine (ok, not quite because 0,0 is inside the none printable area but I corrected for that by checking...
7
2757
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 Graphics = Me.CreateGraphics() Dim s As Size = Me.Size memoryImage = New Bitmap(s.Width, s.Height, myGraphics) Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage)
0
1432
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 specify the margins so Im setting (Im setting both as I dont know which one I should set!) :- margins = new Margins(left, right, top, bottom);
1
2836
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, however, these gaps do not work. No matter what I set the margins to, the printer (HP Color Laserjet) always prints the same (top left corner with about a 5mm gap). Please Help.
5
11153
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 to a laser printer and when printing to an inkjet printer. It's got to be the margins (defined by the printer driver). Is it possible to programmatically override the driver's margins in VB (at our risks)? If so, how to? Thanks in advance,
7
20739
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 printer's physical margins using VB coding? Cheers -- Osmotion Blue
0
9863
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10665
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10302
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9444
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7023
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5686
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4498
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 we have to send another system
3
3139
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.