View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jarek Kujawa[_2_] Jarek Kujawa[_2_] is offline
external usenet poster
 
Posts: 896
Default Excel query to access database

record a macro while creating the query
Tools-Macro-Macros and select your macro, press Edit
go to the SELECT clause and change your filtering condition
accordingly

from
"WHERE (Company Name='Contoso')")

to
"WHERE (Company Name=" & Range("F1").Value & ")")

then use the macro every time you need to generate new data

HIH
pls click YES if it was helpful


On 15 Kwi, 10:53, Piotr wrote:
Hi,

Could you help me to find solution for my problem please?

I’m not very good in Excel and Access but have to create Excel spread sheet
which will take data from Access DB. I almost done it but have one problem
which not able to find solution.

When I create query in Excel using “Query Wizard” there is a step called
“Filter Data”. I would like to use filter for the table like that: Company
Name – equals – Contoso. My problem is that instead using “Contoso” I would
like to take value from filed in Excel document (like $c$2).

Is it possible? How to do this?

Thank you and Kind Regards