hiding field based on if statement

puthenveetil

Registered User.
Local time
Tomorrow, 01:26
Joined
Aug 9, 2004
Messages
94
Hi all,

I had a report in that I like to hide a field if one criteria is met


How can I make it possible. Can someone check this code

if me.fieldname = "name" then
me.fieldname.visible = false
end if


If someone done this before please give a help

thanks
 
Thanks Pat,

may I ask one more thing. Where should I place this code???


Thanks
 
I learned this from Pat last week!

in the report design,

click on the grey detail bar, and create an event in On Format,
and click on the triple dots on the right hand end of the row, and
insert the code there.

sportsguy
 
Pat Hartman said:
Once you change the value of a property, it stays changed. It doesn't reset for each new detail line. You need to handle both the true and false case. The way your code is currently, once the field is hidden, it stays hidden.
Code:
if me.fieldname = "name" then
    me.fieldname.visible = false
else
    me.fieldname.visible = true
end if


Where would I place this code if I where to have the control on a form?
 

Users who are viewing this thread

Back
Top Bottom