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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|