Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Combobox.Value in Access VBA

I have this code:

If Me.Combobox.Value = "My Text" Then

As I want to test if "My Text" is the only value selected, however, the conditional is skipped.

I have also tried

Me.Combobox.Column(1)

and

Me.Combobox.Text

I believe there is some simple solution that I'm just overlooking.

like image 628
hrezs Avatar asked Oct 06 '11 20:10

hrezs


People also ask

How do you get the selected value of a ComboBox in access?

Simply using Object ID = me. combo0. value should also work.

What is value in ComboBox?

A ComboBox displays a text box combined with a ListBox, which enables the user to select items from the list or enter a new value. The user can type a value in the text field or click the button to display a drop down list. You can add individual objects with the Add method.


1 Answers

Me.Combobox.Column(1) decided to work as I retested the possibilities.

like image 88
hrezs Avatar answered Sep 28 '22 14:09

hrezs