I have a combobox, and a button, that makes runs a query with the values it gets from combobox, but it does not seem to get the right value.

I tried using
[Forms]![Kooli otsing]![Combobox]
or
[Forms]![Kooli otsing]![Combobox].[Text]
the query did not work, it seems like it does not get the value from combobox. because it worked with normal TextBox.
I ADDED EXPLAINING PICTURE!!!!!

ADDED PICTURE OF VBA EDITOR

ADDED PICTURE OF ERROR AND NO COMMENT AUTOCOMPLETE


Based on the latest comments you posted on your question, you want to use:
Here’s why. You said you have the following settings for your combobox:
SELECT [Haridusasutused].[ID], [Haridusasutused].[Nimetus] FROM Haridusasutused;Column count of 2 is telling Access to use the first two columns from your rowsource (the only two columns in this case). Bound column is telling access that the default value of the combobox should be the first column of the row source. In this case, that would be
[Haridusasutused].[ID]. Often ID columns are autonumber fields.The reason you were having problems is that
[Forms]![Kooli otsing]![Combo19]was returning data from the ID column (most likely a number) not “Elva Gümnaasium”. By adding the.Column(1)you are telling Access to choose the data from the second column (.Columnis a zero-based array) of the rowsource, ie, “Elva Gümnaasium”.EDIT: Alternatively, you can change the bound column from 1 to 2 and leave the rest alone (ie, you won’t need the
.Column(1)part at all).