IIf Null, then hide

A

Andrew

I have a form based on a query that will display one
result after parameters are entered. Depending on the
parameters entered, some or all of the textboxes will be
filled with data. Is there a way to program the form or
textboxes to only appear if there is data in it? So if it
is null, then hide it. Any direction or advice is greatly
appreciated. thanks,

Andrew.
 
S

Sandra Daigle

In the current event of the form, for each control that potentially needs to
be hidden:

me.text1.visible=not isnull(me.text1)

Note that this is not going to give the desired results if the form is a
continuous form. On a continuous form the visibility of all rows will
adjusted according to the values in the current row.
 
A

Andrew

I get an error when I type the code line. "Expected ="
The highlighted area is at "me.text1"
-----Original Message-----
In the current event of the form, for each control that potentially needs to
be hidden:

me.text1.visible=not isnull(me.text1)

Note that this is not going to give the desired results if the form is a
continuous form. On a continuous form the visibility of all rows will
adjusted according to the values in the current row.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

I have a form based on a query that will display one
result after parameters are entered. Depending on the
parameters entered, some or all of the textboxes will be
filled with data. Is there a way to program the form or
textboxes to only appear if there is data in it? So if it
is null, then hide it. Any direction or advice is greatly
appreciated. thanks,

Andrew.


.
 
A

Andrew

disregard last post. it was a typing error i made.
thankyou for your help. it is working like i wanted now.
-----Original Message-----
In the current event of the form, for each control that potentially needs to
be hidden:

me.text1.visible=not isnull(me.text1)

Note that this is not going to give the desired results if the form is a
continuous form. On a continuous form the visibility of all rows will
adjusted according to the values in the current row.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

I have a form based on a query that will display one
result after parameters are entered. Depending on the
parameters entered, some or all of the textboxes will be
filled with data. Is there a way to program the form or
textboxes to only appear if there is data in it? So if it
is null, then hide it. Any direction or advice is greatly
appreciated. thanks,

Andrew.


.
 

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