Get data from from a Combo

samuvk

Registered User.
Local time
Today, 13:42
Joined
Mar 3, 2010
Messages
24
Anyone call help me and let me konw how can I get the value selected in a Combobox in Access Visual Basic?

I trying to use something like in Visual Basic but doesn't work.

Dim ValueRerturn as string
ValueRerturn = ComboBox5.Text

' So I can get in ValueRerturn the value selected in the combo.

Thank you very much
 
msgbox ComboBox5.Value

msgbox ComboBox5.Column(0)

Try those.
 
What about the textbox?

I'm trying with:

Dim ValueRerturn as string
ValueRerturn = TextBox.Text

ValueRerturn = TextBox.Value

and any of those works

Thanks



 
DO NOT USE .TEXT as that requires the control to have focus. USE .VALUE

There are very few circumstances where you need to use .Text in VBA and I won't confuse you by trying to tell you those right now.

Also, WHAT EVENT do you have this code on? That will also determine why it is or isn't working.
 
I believe I don't have any EVENT, if I select the textBox, right botton, properties, EVENT, I don't have anything there.

I just need to get the text introduce by a user in a textbox, to see if they introduce anything, and in case they didn't ask then to introduce something.

Thanks
 
You can't use VBA without an event. So where did you type this VBA that you have that doesn't work? VBA works off of events. No event; no VBA.
 

Users who are viewing this thread

Back
Top Bottom