 |
|
| Computers Forum Index » Computer - Databases - MS Access » Gutter or Mirror margins in Access report... |
|
Page 1 of 1 |
|
| Author |
Message |
| Kroaky... |
Posted: Wed Oct 21, 2009 11:47 pm |
|
|
|
Guest
|
|
| Back to top |
|
|
|
| Kroaky... |
Posted: Thu Oct 22, 2009 3:40 am |
|
|
|
Guest
|
On Oct 21, 8:14 pm, Salad <o... at (no spam) vinegar.com> wrote:
Quote: Kroaky wrote:
Hi, I have been trawling round the net trying to find an answer to
this, but all the solutions I have found so far have given me errors.
I have a three-column report that needs to be printed on both sides of
the paper (duplex) for insertion in a three-ring binder.
Page 1 = Left margin 0.7 inch Right Margin 0.125 inch
Page 2 = Right margin 0.7 inch Left Margin 0.125 inch
and so on...
I have tried every solution on the web, which are variations on this:
http://bytes.com/topic/access/answers/708866-how-do-i-set-gutter-margins
and this:
http://www.tech-archive.net/Archive/Access/microsoft.public.access.mo...
But I get this error each time:
Run Time Error 2100, the control or subform control is too large for
this location.
If you would like to have a look at the file I am working with it is
here:http://www.kroakys.com/SongbookA.accdb
I am not a VB expert so be gentle ;-)
I appreciate your advice and help. Thank you.
What is permissible on your printer? If you had 8 1/2 x 11, could you
print with no margins? Or do you have printer margins? Can it print
with a 1/8" margin on the right on a single page? For example, on my
printer I have .5 margin on both sides. This 8 1/2 becomes 7 1/2
printable space. I could set my margins smaller, but that won't help me.
Hi, thanks for replying. The pages with the current margins print
fine. The printer margins are 0.125 inch all round. I just need to
shift the margins on the odd/even pages.
The link was bad because of the file type. Try this: http://www.kroakys.com/SongbookA.zip |
|
|
| Back to top |
|
|
|
| Salad... |
Posted: Thu Oct 22, 2009 4:08 am |
|
|
|
Guest
|
Kroaky wrote:
The link is bad. If I remove SongbookA.accdb, it isn't. |
|
|
| Back to top |
|
|
|
| Salad... |
Posted: Thu Oct 22, 2009 4:14 am |
|
|
|
Guest
|
Kroaky wrote:
What is permissible on your printer? If you had 8 1/2 x 11, could you
print with no margins? Or do you have printer margins? Can it print
with a 1/8" margin on the right on a single page? For example, on my
printer I have .5 margin on both sides. This 8 1/2 becomes 7 1/2
printable space. I could set my margins smaller, but that won't help me. |
|
|
| Back to top |
|
|
|
| Salad... |
Posted: Thu Oct 22, 2009 5:17 am |
|
|
|
Guest
|
Kroaky wrote:
Quote: On Oct 21, 8:14 pm, Salad <o... at (no spam) vinegar.com> wrote:
Kroaky wrote:
Hi, I have been trawling round the net trying to find an answer to
this, but all the solutions I have found so far have given me errors.
I have a three-column report that needs to be printed on both sides of
the paper (duplex) for insertion in a three-ring binder.
Page 1 = Left margin 0.7 inch Right Margin 0.125 inch
Page 2 = Right margin 0.7 inch Left Margin 0.125 inch
and so on...
I have tried every solution on the web, which are variations on this:
http://bytes.com/topic/access/answers/708866-how-do-i-set-gutter-margins
and this:
http://www.tech-archive.net/Archive/Access/microsoft.public.access.mo...
But I get this error each time:
Run Time Error 2100, the control or subform control is too large for
this location.
If you would like to have a look at the file I am working with it is
here:http://www.kroakys.com/SongbookA.accdb
I am not a VB expert so be gentle ;-)
I appreciate your advice and help. Thank you.
What is permissible on your printer? If you had 8 1/2 x 11, could you
print with no margins? Or do you have printer margins? Can it print
with a 1/8" margin on the right on a single page? For example, on my
printer I have .5 margin on both sides. This 8 1/2 becomes 7 1/2
printable space. I could set my margins smaller, but that won't help me.
Hi, thanks for replying. The pages with the current margins print
fine. The printer margins are 0.125 inch all round. I just need to
shift the margins on the odd/even pages.
The link was bad because of the file type. Try this: http://www.kroakys.com/SongbookA.zip
OK. Looking at the code, it was written by Allen Browne. I'll trust
his code, yours not so much.
Are you using twips or inches for your shifting. You could draw a few
lines on a dummy report with 1 record (ex Line 1...Line4) of various
sizes; 1/4 inch 1/2 inch, 3/4 inch and 1 inch. Then in the page header
code enter something line
DIm I as integer
For i = 1 to 4
msgbox Me("Line" & i).Width
Debug.print Me("Line" & i).Width
Next
You'll now see the width of each line in twips. You should be able to
figure out the difference in twips between page 1 and page 2...how many
twips to shift. Does this help? You should be able to see if your
current shift is making it makes a control go beyond the size of the report. |
|
|
| Back to top |
|
|
|
| Kroaky... |
Posted: Thu Oct 22, 2009 5:02 pm |
|
|
|
Guest
|
On Oct 22, 10:52 am, "Allen Browne" <AllenBro... at (no spam) SeeSig.invalid>
wrote:
Quote: To verify the code is actually executing, add a line like this to the top of
your procedure:
Debug.Print PageHeaderSection_Format() & " for " & Me.Name & " at " &
Now()
Then add further debug.print statements to see if the controls moved, e.g..:
If IsNumeric(ctl.Tag) Then
Debug.Print ctl.Name & ".Left was " & .Left,
ctl.Left = CInt(ctl.Tag) + iGutter
Debug.Print ctl.Name & ", now is " & .Left
End If
--
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.
"Kroaky" <crisscr... at (no spam) gmail.com> wrote in message
news:ba4e38c6-ae63-4bd3-b0ba-3546a21a22ed at (no spam) 33g2000vbe.googlegroups.com...
On Oct 22, 7:51 am, "Allen Browne" <AllenBro... at (no spam) SeeSig.invalid> wrote:
Nothing happens at all?
If you are using Access 2007, perhaps you are in Layout view or Report
view.
The events don't fire in these views. Try Print or Print Preview.
--
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.
"Kroaky" <crisscr... at (no spam) gmail.com> wrote in message
news:1262d521-2a4a-427d-8451-
I also tried this Allen Browne code on the single column layout.
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
But it doesn't move anything. Even if I change the value of iGutter to
-1550 there's no movement.
I wonder if i am making a newbie error.
Thank you for your patience
Nothing happens at all. Perhaps I am missing something basic.
I added 1 to the tag property field. No change. 1000, still no change
I am definitely in Print Preview.
Hi, I still don't get anything. No output from the code at all. Just
to make sure it's right from the beginning, I right click on The Page
Header and choose Build Code, then I input:
=
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim ctl As Control
Dim iGutter As Integer
Debug.Print PageHeaderSection_Format() & " for " & Me.Name & " at " &
Now()
'Use half an inch gutter on the even pages.
If (Me.Page Mod 2) = 0 Then
iGutter = 720
End If
If IsNumeric(ctl.Tag) Then
Debug.Print ctl.Name & ".Left was " & .Left
ctl.Left = CInt(ctl.Tag) + iGutter
Debug.Print ctl.Name & ", now is " & .Left
End If
Next
End Sub
===
And then I close that window and return to the design view. The design
view has a single field and its label. I select Print Preview. I see
the field output but no code output.
Am I missing some kind of "turn the code on" switch? |
|
|
| Back to top |
|
|
|
| Kroaky... |
Posted: Thu Oct 22, 2009 7:18 pm |
|
|
|
Guest
|
On Oct 22, 2:13 pm, Marshall Barton <marshbar... at (no spam) wowway.com> wrote:
Quote: Kroaky wrote:
Hi, I still don't get anything. No output from the code at all. Just
to make sure it's right from the beginning, I right click on The Page
Header and choose Build Code, then I input:
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim ctl As Control
Dim iGutter As Integer
Debug.Print PageHeaderSection_Format() & " for " & Me.Name & " at " &
Now()
'Use half an inch gutter on the even pages.
If (Me.Page Mod 2) = 0 Then
iGutter = 720
End If
If IsNumeric(ctl.Tag) Then
Debug.Print ctl.Name & ".Left was " & .Left
ctl.Left = CInt(ctl.Tag) + iGutter
Debug.Print ctl.Name & ", now is " & .Left
End If
Next
End Sub
And then I close that window and return to the design view. The design
view has a single field and its label. I select Print Preview. I see
the field output but no code output.
Am I missing some kind of "turn the code on" switch?
Maybe you are. Double check to maje sure the page header
section's OnFormat property contains:
[Event Procedure]
--
Marsh
Yes it contains [Event Procedure]. DDoes the code need to be complied
or otherwise processed to work? |
|
|
| Back to top |
|
|
|
| Marshall Barton... |
Posted: Thu Oct 22, 2009 10:13 pm |
|
|
|
Guest
|
Kroaky wrote:
Quote: Hi, I still don't get anything. No output from the code at all. Just
to make sure it's right from the beginning, I right click on The Page
Header and choose Build Code, then I input:
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim ctl As Control
Dim iGutter As Integer
Debug.Print PageHeaderSection_Format() & " for " & Me.Name & " at " &
Now()
'Use half an inch gutter on the even pages.
If (Me.Page Mod 2) = 0 Then
iGutter = 720
End If
If IsNumeric(ctl.Tag) Then
Debug.Print ctl.Name & ".Left was " & .Left
ctl.Left = CInt(ctl.Tag) + iGutter
Debug.Print ctl.Name & ", now is " & .Left
End If
Next
End Sub
And then I close that window and return to the design view. The design
view has a single field and its label. I select Print Preview. I see
the field output but no code output.
Am I missing some kind of "turn the code on" switch?
Maybe you are. Double check to maje sure the page header
section's OnFormat property contains:
[Event Procedure]
--
Marsh |
|
|
| Back to top |
|
|
|
| Marshall Barton... |
Posted: Fri Oct 23, 2009 1:05 am |
|
|
|
Guest
|
Kroaky wrote:
Quote: On Oct 22, 2:13 pm, Marshall Barton <marshbar... at (no spam) wowway.com> wrote:
Kroaky wrote:
Hi, I still don't get anything. No output from the code at all. Just
to make sure it's right from the beginning, I right click on The Page
Header and choose Build Code, then I input:
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim ctl As Control
Dim iGutter As Integer
Debug.Print PageHeaderSection_Format() & " for " & Me.Name & " at " &
Now()
'Use half an inch gutter on the even pages.
If (Me.Page Mod 2) = 0 Then
iGutter = 720
End If
If IsNumeric(ctl.Tag) Then
Debug.Print ctl.Name & ".Left was " & .Left
ctl.Left = CInt(ctl.Tag) + iGutter
Debug.Print ctl.Name & ", now is " & .Left
End If
Next
End Sub
And then I close that window and return to the design view. The design
view has a single field and its label. I select Print Preview. I see
the field output but no code output.
Am I missing some kind of "turn the code on" switch?
Maybe you are. Double check to maje sure the page header
section's OnFormat property contains:
[Event Procedure]
Yes it contains [Event Procedure]. Does the code need to be complied
or otherwise processed to work?
You should use Debug - Compile before testing any change,
but the code will be compiled one way or another before
before it runs.
The only other thing I can think that might cause the code
to not be called is if your page header section is named
something other than PageHeaderSection.
What happens when you click the [...] builder button on the
OnFormat line in the page header section's property sheet?
It should put the cursor in your code procedure.
--
Marsh |
|
|
| Back to top |
|
|
|
| Allen Browne... |
Posted: Fri Oct 23, 2009 5:01 am |
|
|
|
Guest
|
Or, you may find that no code is running in your Access 2007 database unless
it's in a trusted location.
To trust your folder, click:
* Office Button (top left)
* Access Options (bottom of dialog)
* Trust Center (left)
* Trust Center Settings (button)
* Trusted Locations (left)
* Add new location (button)
--
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.
"Marshall Barton" <marshbarton at (no spam) wowway.com> wrote in message
news:jrh1e55u9uqcgm64u6ghpi02rk3dfcugii at (no spam) 4ax.com...
Quote: Kroaky wrote:
On Oct 22, 2:13 pm, Marshall Barton <marshbar... at (no spam) wowway.com> wrote:
Kroaky wrote:
Hi, I still don't get anything. No output from the code at all. Just
to make sure it's right from the beginning, I right click on The Page
Header and choose Build Code, then I input:
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim ctl As Control
Dim iGutter As Integer
Debug.Print PageHeaderSection_Format() & " for " & Me.Name & " at " &
Now()
'Use half an inch gutter on the even pages.
If (Me.Page Mod 2) = 0 Then
iGutter = 720
End If
If IsNumeric(ctl.Tag) Then
Debug.Print ctl.Name & ".Left was " & .Left
ctl.Left = CInt(ctl.Tag) + iGutter
Debug.Print ctl.Name & ", now is " & .Left
End If
Next
End Sub
And then I close that window and return to the design view. The design
view has a single field and its label. I select Print Preview. I see
the field output but no code output.
Am I missing some kind of "turn the code on" switch?
Maybe you are. Double check to maje sure the page header
section's OnFormat property contains:
[Event Procedure]
Yes it contains [Event Procedure]. Does the code need to be complied
or otherwise processed to work?
You should use Debug - Compile before testing any change,
but the code will be compiled one way or another before
before it runs.
The only other thing I can think that might cause the code
to not be called is if your page header section is named
something other than PageHeaderSection.
What happens when you click the [...] builder button on the
OnFormat line in the page header section's property sheet?
It should put the cursor in your code procedure.
--
Marsh |
|
|
| Back to top |
|
|
|
|
|
All times are GMT
The time now is Tue Dec 15, 2009 9:37 am
|
|