Forum Discussion

DCat1223's avatar
DCat1223
Frequent Contributor
9 years ago

Assign a variable from a ComboBox in a UserForm

Hi...  I am working with a UserForm in a Keyword test.  The Keyword test first opens my userform, which has two dropdown boxes.

  • Dropdown 1 is XferType, which has 3 different selections.
  • Dropdown 2 is Department which has about 25 or so different selections.

Based on what the user selects in the dropdown boxes, I am trying to assign those values to variables in my Keyword test using the Set Variable statement.  The variables are TransferType and Dept.

 

Then I have a simple message appear showing the value of the TransferType variable to verify that the value assigned correctly.  I keep getting an Error -  Type mismatch.

 

I have attached a screenshot showing what I have going on.  Does anybody see what I am missing here?

 

Thanks for your time. 

 

Dave.

 

 

  • DCat1223's avatar
    DCat1223
    9 years ago

    That was it.  Thank you, Joseph! 

  • Looks like you're trying to save the ComboBox object itself.  You probably want the Text property of the ComboBox.

    • DCat1223's avatar
      DCat1223
      Frequent Contributor

      That was it.  Thank you, Joseph!