A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Hide controls where the value is null



 
 
Thread Tools Display Modes
  #1  
Old May 9th, 2007, 05:32 PM posted to microsoft.public.access.reports
Super Wife Mom
external usenet poster
 
Posts: 10
Default Hide controls where the value is null

My report has a list of 100+ controls taken from a select query. Each of the
items only contains a numeric value and has a corresponding label. Like this:

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 2 0.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00
Donation Purpose 5 0.00

It currently displays every item, whether the value is zero or greater.
What I would like for it to do instead is to suppress or hide the items (&
their corresponding labels) with a zero value and to scoot the items with a
greater-than-zero value up to the next available spot on the list.

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00

Any suggestions gratefully received!
  #2  
Old May 9th, 2007, 07:04 PM posted to microsoft.public.access.reports
Ofer Cohen
external usenet poster
 
Posts: 1,683
Default Hide controls where the value is null

To the RecordSource of the report add a critera 0 Or 0

Where [Control Value] 0

That will remove alll the records that are equal to 0

--
Good Luck
BS"D


"Super Wife Mom" wrote:

My report has a list of 100+ controls taken from a select query. Each of the
items only contains a numeric value and has a corresponding label. Like this:

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 2 0.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00
Donation Purpose 5 0.00

It currently displays every item, whether the value is zero or greater.
What I would like for it to do instead is to suppress or hide the items (&
their corresponding labels) with a zero value and to scoot the items with a
greater-than-zero value up to the next available spot on the list.

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00

Any suggestions gratefully received!

  #3  
Old May 9th, 2007, 07:41 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Hide controls where the value is null

Super Wife Mom wrote:

My report has a list of 100+ controls taken from a select query. Each of the
items only contains a numeric value and has a corresponding label. Like this:

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 2 0.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00
Donation Purpose 5 0.00

It currently displays every item, whether the value is zero or greater.
What I would like for it to do instead is to suppress or hide the items (&
their corresponding labels) with a zero value and to scoot the items with a
greater-than-zero value up to the next available spot on the list.

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00

Any suggestions gratefully received!


Couple of ways. You can use a line of code for each text
box:
Me.textbox1.Visible = (Me.textbox1 0)

Or, you can change all the labels to text boxes and use
expressions for both text boxes. The value expression could
be:
=IIf(field = 0, Null, field)
and the "label" text box expression:
=IIf(field = 0, Null, "Donation Purpose 1")

Either way, set all text boxes' and their section's
CanShrink property to Yes.

--
Marsh
MVP [MS Access]
  #4  
Old May 9th, 2007, 08:03 PM posted to microsoft.public.access.reports
Super Wife Mom
external usenet poster
 
Posts: 10
Default Hide controls where the value is null

Thanks for this. I had a go, but because there is a seperate control for
each "control value" in my example, it wouldn't work, but I may try to
redesign things to see if I can make this work if I don't get any other
suggestions. Thanks for your time.

"Ofer Cohen" wrote:

To the RecordSource of the report add a critera 0 Or 0

Where [Control Value] 0

That will remove alll the records that are equal to 0

--
Good Luck
BS"D


"Super Wife Mom" wrote:

My report has a list of 100+ controls taken from a select query. Each of the
items only contains a numeric value and has a corresponding label. Like this:

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 2 0.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00
Donation Purpose 5 0.00

It currently displays every item, whether the value is zero or greater.
What I would like for it to do instead is to suppress or hide the items (&
their corresponding labels) with a zero value and to scoot the items with a
greater-than-zero value up to the next available spot on the list.

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00

Any suggestions gratefully received!

  #5  
Old May 9th, 2007, 08:11 PM posted to microsoft.public.access.reports
Super Wife Mom
external usenet poster
 
Posts: 10
Default Hide controls where the value is null

Yippee this worked! The only thing is that the fields where there are values
greater than zero are dotted all down the page with big gaps in between where
the fields which equal zero are invisible. Any idea on how to make the ones
with values greater than zero appear one right after the other?

"Marshall Barton" wrote:

Super Wife Mom wrote:

My report has a list of 100+ controls taken from a select query. Each of the
items only contains a numeric value and has a corresponding label. Like this:

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 2 0.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00
Donation Purpose 5 0.00

It currently displays every item, whether the value is zero or greater.
What I would like for it to do instead is to suppress or hide the items (&
their corresponding labels) with a zero value and to scoot the items with a
greater-than-zero value up to the next available spot on the list.

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00

Any suggestions gratefully received!


Couple of ways. You can use a line of code for each text
box:
Me.textbox1.Visible = (Me.textbox1 0)

Or, you can change all the labels to text boxes and use
expressions for both text boxes. The value expression could
be:
=IIf(field = 0, Null, field)
and the "label" text box expression:
=IIf(field = 0, Null, "Donation Purpose 1")

Either way, set all text boxes' and their section's
CanShrink property to Yes.

--
Marsh
MVP [MS Access]

  #6  
Old May 9th, 2007, 10:16 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Hide controls where the value is null

Which way did you decide to use?

Either you forgot to set some text box's or the Section's
CanShrink property or you have other non shrinking controls
next to the blank areas.
--
Marsh
MVP [MS Access]


Super Wife Mom wrote:
Yippee this worked! The only thing is that the fields where there are values
greater than zero are dotted all down the page with big gaps in between where
the fields which equal zero are invisible. Any idea on how to make the ones
with values greater than zero appear one right after the other?

"Marshall Barton" wrote:

Super Wife Mom wrote:

My report has a list of 100+ controls taken from a select query. Each of the
items only contains a numeric value and has a corresponding label. Like this:

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 2 0.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00
Donation Purpose 5 0.00

It currently displays every item, whether the value is zero or greater.
What I would like for it to do instead is to suppress or hide the items (&
their corresponding labels) with a zero value and to scoot the items with a
greater-than-zero value up to the next available spot on the list.

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00


Couple of ways. You can use a line of code for each text
box:
Me.textbox1.Visible = (Me.textbox1 0)

Or, you can change all the labels to text boxes and use
expressions for both text boxes. The value expression could
be:
=IIf(field = 0, Null, field)
and the "label" text box expression:
=IIf(field = 0, Null, "Donation Purpose 1")

Either way, set all text boxes' and their section's
CanShrink property to Yes.

  #7  
Old May 10th, 2007, 09:54 PM posted to microsoft.public.access.reports
Super Wife Mom
external usenet poster
 
Posts: 10
Default Hide controls where the value is null

Thanks for the help. I tried the first way you suggested which worked and
have now set the "CanShrink" propety to Yes and have managed to get rid of
all the blank lines. Thanks again.

"Marshall Barton" wrote:

Which way did you decide to use?

Either you forgot to set some text box's or the Section's
CanShrink property or you have other non shrinking controls
next to the blank areas.
--
Marsh
MVP [MS Access]


Super Wife Mom wrote:
Yippee this worked! The only thing is that the fields where there are values
greater than zero are dotted all down the page with big gaps in between where
the fields which equal zero are invisible. Any idea on how to make the ones
with values greater than zero appear one right after the other?

"Marshall Barton" wrote:

Super Wife Mom wrote:

My report has a list of 100+ controls taken from a select query. Each of the
items only contains a numeric value and has a corresponding label. Like this:

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 2 0.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00
Donation Purpose 5 0.00

It currently displays every item, whether the value is zero or greater.
What I would like for it to do instead is to suppress or hide the items (&
their corresponding labels) with a zero value and to scoot the items with a
greater-than-zero value up to the next available spot on the list.

Label Control Value
Donation Purpose 1 30.00
Donation Purpose 3 12.00
Donation Purpose 4 28.00


Couple of ways. You can use a line of code for each text
box:
Me.textbox1.Visible = (Me.textbox1 0)

Or, you can change all the labels to text boxes and use
expressions for both text boxes. The value expression could
be:
=IIf(field = 0, Null, field)
and the "label" text box expression:
=IIf(field = 0, Null, "Donation Purpose 1")

Either way, set all text boxes' and their section's
CanShrink property to Yes.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:30 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.