Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

Conditional display of textbox on form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 30 Jun 2007 19:27 GMT
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?
fredg - 30 Jun 2007 20:55 GMT
> I only want a textbox to display if the control source value is not null or
> not an empty string.
[quoted text clipped - 9 lines]
>
> 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. "

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Douglas J. Steele - 30 Jun 2007 20:57 GMT
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?

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

>I only want a textbox to display if the control source value is not null or
>not an empty string.
[quoted text clipped - 9 lines]
>
> Can this be done? If so how?
missinglinq - 01 Jul 2007 01:04 GMT
>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!

Signature

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

Answers/posts based on Access 2000

Wei Lu [MSFT] - 04 Jul 2007 09:25 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.