query based on combo box

J

JasonT

I have a form with a combo box on it. I am trying to create a query with the
query designer. I noticed that the cboSomething.column(1) does not work. Is
there another way to use a combo box in a query and refer to a specific
column in it? The work around I found is to assign the property I want to a
text box and use it from there. It seems like there would be a better way to
do this. Why isn't the column property available?
 
M

Marshall Barton

JasonT said:
I have a form with a combo box on it. I am trying to create a query with the
query designer. I noticed that the cboSomething.column(1) does not work. Is
there another way to use a combo box in a query and refer to a specific
column in it? The work around I found is to assign the property I want to a
text box and use it from there. It seems like there would be a better way to
do this. Why isn't the column property available?


I don't know the Why (probably something to do with a syntax
conflict).

You can get the result you want by using a text box in the
query instead of the combo's column property. Make the text
box on the form invisible and set its value in the combo
box's AfterUpdate event:

Me.thetextbox = Me.cboSomething.Column(1)
 
M

Max Smart

What I did was store my Column(0) value in a public variable in a code
module and created a GetValue() function which I call from my query criteria
row.

Max
 

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