query based on combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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)
 
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
 
Back
Top