Scott Stewart

Scott Stewart

  • 1.5k
  • 189
  • 18k

Getting the value from a combobox

Mar 30 2012 8:39 AM
I need to get the text value from a combo box on one form to assign to a variable in a separate class. I tried
stName=frmParent.ActiveForm.Controls["tblStatesComboBox"].Text
That generated an error that said it was not associated with an object.

What is the proper syntax for reading control values in a separate form. My class is NOT a form. It is just a small class with several values and properties.

Thanks

Answers (7)