vba - How to get value of a Yes/No checkbox control when passed to another class? -
i have form tform based on table t. there yes/no field choice in t. add field tform, added checkbox choicecheck form. trying choicecheck's value in class, sqlpreparer, using construct sql statements based on values in tform:
private function controltovaluestr(ctrl control) string if ctrl.name = "choicecheck" controltovaluestr = ctrl.value else 'return control's value wrapped in quote marks controltovaluestr = quotewrap(ctrl.value) end if end function however, when call sqlpreparer.controltovaluestr() , pass choicecheck, ctrl.value statement gives me error:
run-time error '438': object doesn't support property or method i'm able value in class tform follows:
me.choicecheck.value all of text box controls of type string work in both situations. i'm having problem textbox type in t long.
the problem had named label choicecheck, not checkbox itself. same issue present textbox. in both cases, changing control names in design view match vba code resolved issue.
Comments
Post a Comment