Combo box visual basic

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?
 
L

Larry Linson

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
 
P

PC Datasheet

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top