Conditional display of textbox on form

D

Dave

I only want a textbox to display if the control source value is not null or
not an empty string.

I set the text box can shrink property to true and then test the value in
the form load event.

If the value is NULL or empty the text box does not display but there is an
unsightly gap where it should display.

The display mode is continuous forms so I want to recover the space where
the box would have displayed.

Can this be done? If so how?
 
F

fredg

I only want a textbox to display if the control source value is not null or
not an empty string.

I set the text box can shrink property to true and then test the value in
the form load event.

If the value is NULL or empty the text box does not display but there is an
unsightly gap where it should display.

The display mode is continuous forms so I want to recover the space where
the box would have displayed.

Can this be done? If so how?

See VBA help on CanShrink....

"This property affects the display of form sections and controls only
when the form is printed or previewed, not when the form is displayed
in Form view, Datasheet view, or Design view. "
 
D

Douglas J. Steele

It's not clear to me how you'd expect a continuous form to hide a particular
field: the other fields will still be displaying their data. Or is the only
field on the form? If so, why not just eliminate the data that's Null or an
emptry string from the form's recordsource?
 
M

missinglinq via AccessMonster.com

I set the text box can shrink property to true and then test the value in
the form load event.

This makes no sense! As FredG pointed out, CanShrink only works when printing
a form/report! Then you "test the value in the form load event." You don't
say *how* you test it, but anything you *test* in the form load event will
only test the first record's value for the text box, and then, in a
continuous form, apply it to the text box in all the records! Something is
not being reported correctly here.
If the value is NULL or empty the text box does not display but there is an
unsightly gap where it should display.

Assumning that you could get the the text box to disappear, on a record by
record basis, you want the remaining text boxes to be arranged evenly for
that row? So some rows would have, for the purposes of argument, one less
text box than others, with the remaining boxes spaced evenly, while other
rows would, as Doug said, still be displaying their data in all their text
boxes? This, too, makes no sense!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
W

Wei Lu [MSFT]

Hi ,

How is everything going? Please feel free to let me know if you need any
assistance.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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