UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Inhibit Printing in Access Report    
 
   
orvos
post Apr 6 2010, 09:17 AM
Post #1

New Member
Posts: 9



How can I stop printing a particular line of totals in an Access 2007 Report?

If you have only one “line”, putting a “Total” underneath is unnecessary (and looks ridiculous). Like this:

John Smith £100.00 £40.00 £60.00
Totals £100.00 £40.00 £60.00

In GroupFooter3, for example, I have “totals” like (=Sum([xyz1]) and an invisible control (=[txtcontrol]) where txtcontrol = the number of “lines” added up in each total.

In GroupFooter3_Format(Cancel… my code is <if Me.txtcounter.value=1 then Reports(“Main_Report”).PrintSection=False> should work (I think) but doesn’t!

Where have I gone wrong?

Help would be very much appreciated. Thank you.

Orvos
Go to the top of the page
 
+
dashiellx2000
post Apr 6 2010, 09:25 AM
Post #2

UtterAccess VIP
Posts: 9,209
From: Maryland



I've never done it like that. When I've wanted to hide the footer, I just change the objects visible property to false.
Go to the top of the page
 
+
HiTechCoach
post Apr 6 2010, 12:44 PM
Post #3

UtterAccess VIP
Posts: 18,396
From: Oklahoma City, Oklahoma



QUOTE (orvos @ Apr 6 2010, 09:17 AM) *
How can I stop printing a particular line of totals in an Access 2007 Report?

If you have only one “line”, putting a “Total” underneath is unnecessary (and looks ridiculous). Like this:

John Smith £100.00 £40.00 £60.00
Totals £100.00 £40.00 £60.00

In GroupFooter3, for example, I have “totals” like (=Sum([xyz1]) and an invisible control (=[txtcontrol]) where txtcontrol = the number of “lines” added up in each total.

In GroupFooter3_Format(Cancel… my code is <if Me.txtcounter.value=1 then Reports(“Main_Report”).PrintSection=False> should work (I think) but doesn’t!

Where have I gone wrong?

Help would be very much appreciated. Thank you.

Orvos


I normally do it like this:

CODE
   Me.GroupFooter3.Visible = Not (Me.txtcounter=1)


or this

CODE
If Me.txtcounter =1 then
   Me.GroupFooter3.Visible =False
Else
   Me.GroupFooter3.Visible = True
End If

Go to the top of the page
 
+
orvos
post Apr 7 2010, 11:04 AM
Post #4

New Member
Posts: 9



QUOTE (dashiellx2000 @ Apr 6 2010, 03:25 PM) *
I've never done it like that. When I've wanted to hide the footer, I just change the objects visible property to false.

Yes, but I had to attempt some code because I wanted to hide the footer if there was only one detail line...I didn't exlain my problem very clearly. Sorry. But many thanks all the same.
Cheers!
Rupert Sutton
Chislehurst, Kent, UK

This post has been edited by orvos: Apr 7 2010, 11:10 AM
Go to the top of the page
 
+
orvos
post Apr 7 2010, 11:19 AM
Post #5

New Member
Posts: 9



QUOTE (HiTechCoach @ Apr 6 2010, 06:44 PM) *
I normally do it like this:

CODE
   Me.GroupFooter3.Visible = Not (Me.txtcounter=1)


or this

CODE
If Me.txtcounter =1 then
   Me.GroupFooter3.Visible =False
Else
   Me.GroupFooter3.Visible = True
End If

Many thanks indeed for your two pieces of code. Both work excellently! Now I have to choose which one to use! Life's full of problems!!

Rupert Sutton
Chislehurst, Kent, UK
Go to the top of the page
 
+
HiTechCoach
post Apr 7 2010, 11:36 AM
Post #6

UtterAccess VIP
Posts: 18,396
From: Oklahoma City, Oklahoma



QUOTE (orvos @ Apr 7 2010, 11:19 AM) *
Many thanks indeed for your two pieces of code. Both work excellently! Now I have to choose which one to use! Life's full of problems!!

Rupert Sutton
Chislehurst, Kent, UK


Rupert,

You're welcome. Glad we could assist.

The two code samples are identical in results. The difference is in the style/use of writing VBA code.

The first one is how I generally write stuff. I call it shorthand. After doing this for 30+ years, the single liner of code is easy for me to read and understand.

The second one is what I call "Human Friendly". It does the exact same thing, it is just written in a more verbose format. The logic is easier to follow for people that are not as experience in VBA.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 07:55 PM