main logo
Subject: Changing visibility of a control via a check box
Author: Lynette Tillner
Posted: 2002/05/16 13:04:54
 
View Entire Thread
New Search


I have a checkbox, a textbox and a combo box that need to work together

(I remember seeing this somewhere but lost the code snippet!)

the checkbox toggles whether the textbox is visible. the combo box is a dropdown list of the distinct items in a field, -- when you check "NEW" the textbox appears and a new item can be inserted (added for the record and the combo refreshed so it becomes part of the dropdown list)

so my method added to the form is setnewccat()
and is is called from the checkbox's interactivechange method.

the setnewcat() method is:

IF THISFORM.ctn_de_asset_pg1.ctn_cat.chkAddCat.Value
* If the checkbox is checked
THISFORM.ctn_de_asset_pg1.ctn_cat.txtccategory.visible = .T.
THISFORM.ctn_de_asset_pg1.ctn_cat.cbo_cat.visible = .F.
ELSE
THISFORM.ctn_de_asset_pg1.ctn_cat.txtccategory.visible = .F.
THISFORM.ctn_de_asset_pg1.ctn_cat.cbo_cat.visible = .T.
ENDIF

but I get a Data type/Mmismatch error:

Error #: 9
Message: Data type mismatch.
Line #: 1
Code: IF THISFORM.ctn_de_asset_pg1.ctn_cat.chkAddCat.Value
Method: setcatnew
Object: fa_deasset_form

this seems like it should work, or do I have my syntax all wrong???

Thanks for any help!


Lynette
ltillner .AT. yahoo .DO.T com

 
©2002 Lynette Tillner
<-- Prior Message New Search Next Message -->