Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding report field based on field value

Status
Not open for further replies.

flynbye

Programmer
Nov 16, 2001
68
US
Here I go again asking simple questions! (I hope)

Have a report that displays a summary of large proposal / change orders for construction firm. In a couple of places on the form I'd like to check the value of a field [COID] and if the value is equal to 1000 not display the field.

Anyone have a quick suggeston for someone who should be seeing this but is not?

Thanks in advance for all your help... (you know some day I hope to be of use in these forums too)

Thanks All!
 
Hi,

From what you've said I think the following should work.

In the control source for the field you want to be blank

=iif([Coid]="1000"," ",[FieldName])

If coid is numeric then you won't need the " around 1000

Also, on the Other tab of the properties for the control, change the name of the control. i.e. in the above example, leaving the control name as FieldName will result in #Error# being displayed on your report as Access gets confused. Change to something like FieldNameTxt

Hope this works for you

JC
 
Hmmm... sounds simple enough... thanks JC I'll give it a try and let you know how it works out. :)

Chris
 
Just wanted to post a quick follow-up JC... suggestion worked like a champ, I ended up changing the COID field name to txtCOID and then using the following statement to blank the lines if value was zero.

=iif([COID]=0, " ", [COID])

Only problem that I ended up having that threw me for just a second is that Access in all its helpful nature then found all my references to the field name before it was changed (ie COID to txtCOID) and changed them to the new text field name effectively hosing up a couple of different value sum fields. Once that was resolved the report works great.

Thanks again,
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top