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 7 6455
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
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
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
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
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.
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.
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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">
|
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
|
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
|
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...
|
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...
| |
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)
|
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);
|
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.
|
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,
|
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
|
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...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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,...
|
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...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
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...
| |