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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide/show text box in continuous form

Status
Not open for further replies.

sqlJunior

Technical User
Sep 22, 2002
123
TH

I have a continuous form and I wish to hide or show a text box in each record depending on whether a check box in the same record is ticked.

I have tried the procedure below but this will either hide or show the text box for all records the same, depending on whether the current record is checked or not.

Private Sub Form_Current()
If Me!chkEnd.Value = -1 Then
Me![cboItemEnd].Visible = True
Else
Me!cboItemEnd.Visible = False
End If
End Sub

Is there a way I can hide/show the text box selectively for each record.
 
I don't think you can do that, actually.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Hi SQLJunior
JeremyNYC is correct in that it is not possible but if the text box is to display data only and not to allow data entry then there is a nifty trick you can do.

make the text box as simple as you can, set it's sunken property to flat and if possible set it's background to transparent ie. try and display the text only. Create a label exactly the same size and set the font colour to the same as the background. Place it exactly on the top of the textbox (by holding down the ctrl button whilst uising the arrow keys you have more control in moving the label. Set the controlsource property of the label to:

=IIF(forms!formname!ChkEnd = -1, forms!formname!cboItemEnd, "")

replace formname with your form's name

HTH Savil
 

Thanks for your input JeremyNYC & HTH Savil,

Unfotunately the control I need to show/hide is for input so I guess I'll have to give up on this and rebuild the form from another angle.

SqlJunior
 
It has to be visible/not visible?

Just to expand a little on Savils suggestions, Conditional formatting (format menu) includes the possibility to enable/disable controls on continous forms based on value of another control (thru the "expression is" choice, rather than "Field value is") - this wouldn't be adueqate? Perhaps whith some of the alterations suggested by Savil, it might resemble not visible...

Roy-Vidar
 

Hi RoyVidar,

I'd like to try out your suggestion but you are way ahead of me. Could you tell me what "expression is" is and where I might start.

SqlJunior

 
Hi again!

Hoping you have a2000+ versions, which include the conditional formatting thingie (or else, you've probably commented on it in the last post;-))

In design view, select your textbox. Then Format | Conditional Formatting.

The first (left most) thingie, is a combo where the default selection is "Field value is". In stead of that, select "Expression is".

In the box to the right, enter the name of the name of your control (chkEnd), change the format (fill/text color, enabled...) and you'd be able to see some results that I hope are, at least in the direction you need.

Roy-Vidar
 

Thanks for your input RoyVidar.

I've tried conditional formatting and in combination with various other things (events etc) but nothing comes out really satisfacatory.

Thanks anyway
SqlJunior
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top