View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default SELECT statement

I would guess something like this:

"SELECT table1.company FROM pathname WHERE Company_Name =" & "'" &
me.combobox1.Value & "'"

Where company_name is the column in access where you would look for the
value in combobox1. Replace with the real field name.

==
Regards,
Tom Ogilvy


"Ali" wrote in message
...
Hello,

Im trying to retrieve some data from an access table into excel. I have a

drop down list, where I want the chosen value to be the criteria for a query
statement. How can I use variables to be used as the criteria to filter data
within a query statement.

"SELECT table1.company FROM pathname WHERE (table1.company = 'value from

combo box' "

any ideas??

im probably being very thick!

many thanks ahead.