Full Version: Inhibit Printing in Access Report
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
orvos
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
dashiellx2000
I've never done it like that. When I've wanted to hide the footer, I just change the objects visible property to false.
HiTechCoach
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

orvos
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
orvos
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
HiTechCoach
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.