Visible Property in Group Header

L

Louise54

I have a label that I would like to have visible/invisible depending on the
value of a field in the group header. I can't seem to get it to work. My
macro looks like this:

CONDITION: [gsaflag]="OM"
SetValue

ITEM: [Reports]![r_SeparateQuote]![OpenMkt].[Visible]
EXPRESSION: Yes

followed by
CONDITION: [gsaflag]<="OM"
Set Value

ITEM: [Reports]![r_SeparateQuote]![OpenMkt].[Visible]
EXPRESSION: No


where OpenMkt is the name of the label (which is a line of text). I have
tried calling the macro from the ON FORMAT of the group header's property,
and have also tried it on the ON PRINT. It doesn't work in either case. Any
ideas what I'm missing. Thanks so much in advance.
 
S

Steve Schapel

Louise,

Do I understand correctly that the OpenMkt label is also in the group
header section?
 
L

Louise54

Yes, it is. The gsaflag field is also in the group header. Thank you for
your response.
Louise

Steve Schapel said:
Louise,

Do I understand correctly that the OpenMkt label is also in the group
header section?

--
Steve Schapel, Microsoft Access MVP
I have a label that I would like to have visible/invisible depending on the
value of a field in the group header. I can't seem to get it to work. My
macro looks like this:

CONDITION: [gsaflag]="OM"
SetValue

ITEM: [Reports]![r_SeparateQuote]![OpenMkt].[Visible]
EXPRESSION: Yes

followed by
CONDITION: [gsaflag]<="OM"
Set Value

ITEM: [Reports]![r_SeparateQuote]![OpenMkt].[Visible]
EXPRESSION: No


where OpenMkt is the name of the label (which is a line of text). I have
tried calling the macro from the ON FORMAT of the group header's property,
and have also tried it on the ON PRINT. It doesn't work in either case. Any
ideas what I'm missing. Thanks so much in advance.
 
S

Steve Schapel

Louise,

I would expect this macro to work on the Format event of the group
header section. Except you don't need to specify the report, in other
words, in the Item argument of the SetValue macro, put like this
[OpenMkt].[Visible]

Just check to see that the OpenMkt isn't associated with any other
control, e.g. that it doesn't have an attached textbox.
 
L

Louise54

Still not working. Have used before in the detail section and worked fine.
Are there any label properties I need to be concerned with? In the properties
for this label I have Visible set to Yes. The macro is on the Format event of
the group header section, and I removed the report name from the Item as you
suggested. Any other thoughts?
Thanks ahead.
Louise

Steve Schapel said:
Louise,

I would expect this macro to work on the Format event of the group
header section. Except you don't need to specify the report, in other
words, in the Item argument of the SetValue macro, put like this
[OpenMkt].[Visible]

Just check to see that the OpenMkt isn't associated with any other
control, e.g. that it doesn't have an attached textbox.

--
Steve Schapel, Microsoft Access MVP
Yes, it is. The gsaflag field is also in the group header. Thank you for
your response.
Louise
 
S

Steve Schapel

Louise,

As regards the value of the [gsaflag] that you are using in the macro
Condition, what are the other potential values that can be entered in
this field? I think you have made a mistake in the second Condition
statement being:
[gsaflag]<="OM"
This *includes* the case of [gsaflag]="OM" and so the action of the
first SetValue (where the condition is [gsaflag]="OM") will be
over-ridden. Not only that, but you do not cater to the case of
[gsaflag]>"OM". So it seems to me that maybe what you meant was:
[gsaflag]<>"OM"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top