Report Fields

  • Thread starter Thread starter Josh
  • Start date Start date
J

Josh

I was wondering if there was a way to have a report
display a field only if it contains a certain value. I
have a form that contains several check boxes that users
select to select options they want. Is there a way to
have a report list the names of the fields that are
checked yes and not display the ones that are not
checked? For Example:

Form looks like this...
Field A [] Field B[x] Field C [x]

The report would then look like this.....
Field B Field C

Thanks,

Josh
 
Yes, place an unbound text box on your report with something like the
following in the source...

=IIf([FieldA],"Field A","")


This will display nothing if [Field A] is not checked. It will display the
literal "Field A" if checked.


Rick B



I was wondering if there was a way to have a report
display a field only if it contains a certain value. I
have a form that contains several check boxes that users
select to select options they want. Is there a way to
have a report list the names of the fields that are
checked yes and not display the ones that are not
checked? For Example:

Form looks like this...
Field A [] Field B[x] Field C [x]

The report would then look like this.....
Field B Field C

Thanks,

Josh
 
You can hide the fields easily enough by using the code
Josh provided. Don't expect the fields to be shifted left
when they are hidden though. Can Shrink/Can Grow only
eliminates vertical space.
 
Oops - I did not notice that you would want them shifted. You might do
something like...


=IIf([FieldA],"Field A ","") & IIf([FieldB],"Field B ","") &
IIf([FieldC],"Field C ","")


This would give results like...

Field A Field B Field C
or
Field B Field C
or
Field A Field C



Rick B




You can hide the fields easily enough by using the code
Josh provided. Don't expect the fields to be shifted left
when they are hidden though. Can Shrink/Can Grow only
eliminates vertical space.
 
I have some large text fields in my report that are only
partially filled. I have CanShrink and CanGrow set to yes
but my report still consists mainly of blank space -
vertical space is not being eliminated. What am I doing
wrong?
-----Original Message-----
You can hide the fields easily enough by using the code
Josh provided. Don't expect the fields to be shifted left
when they are hidden though. Can Shrink/Can Grow only
eliminates vertical space.
-----Original Message-----
I was wondering if there was a way to have a report
display a field only if it contains a certain value. I
have a form that contains several check boxes that users
select to select options they want. Is there a way to
have a report list the names of the fields that are
checked yes and not display the ones that are not
checked? For Example:

Form looks like this...
Field A [] Field B[x] Field C [x]

The report would then look like this.....
Field B Field C

Thanks,

Josh
.
.
 
If you have set the CanShrink property of the Section, too, then I'd look
for Controls alongside the Controls that you want to shrink... shrinking has
to work for the whole width of the report to take effect.

Larry Linson
Microsoft Access MVP

miaplacidus said:
I have some large text fields in my report that are only
partially filled. I have CanShrink and CanGrow set to yes
but my report still consists mainly of blank space -
vertical space is not being eliminated. What am I doing
wrong?
-----Original Message-----
You can hide the fields easily enough by using the code
Josh provided. Don't expect the fields to be shifted left
when they are hidden though. Can Shrink/Can Grow only
eliminates vertical space.
-----Original Message-----
I was wondering if there was a way to have a report
display a field only if it contains a certain value. I
have a form that contains several check boxes that users
select to select options they want. Is there a way to
have a report list the names of the fields that are
checked yes and not display the ones that are not
checked? For Example:

Form looks like this...
Field A [] Field B[x] Field C [x]

The report would then look like this.....
Field B Field C

Thanks,

Josh
.
.
 
Back
Top