Combo box visual basic

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On a form I have a button that runs an update query. I need to pull the text
selected on a combo box to use in this query, how do I retrieve the data
that the user selected on the combo box?
 
On a form I have a button that
runs an update query. I need to
pull the text selected on a combo
box to use in this query, how do
I retrieve the data that the user
selected on the combo box?

If it is the actual bound value of a combo named cboX, you can set a
variable strX with its value using

strX = Me!cboX

On the other hand, setting a variable may not be what you want to do, so if
you'll clarify, perhaps someone can give you a more specific answer.

Larry Linson
Microsoft Access MVP
 
Forms!NameOfYourForm!NameOfComboBox

Note that the value you get for the combobox depends on the Bound Column
property. You may need to add the Column property to the expression above to
get the text you want.
 
Back
Top