View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Drew Drew is offline
external usenet poster
 
Posts: 13
Default Filter Access query results based on selected information

Thanks! Any thoughts on how to get the results to update and filter based on
changing the value within a given cell. From the example below, I would like
the results of the query to return only purchases from Acme when I choose
Acme from a drop down in a different tab.
--
Drew


"joel" wrote:


When pulling dta from Access you use a SQL (String query Language). the
VBA queries call this Commandtext.

You can easily see this by recording a macro and manually performing
the query by using the worksheet menu

Data - Import External Data - Import Data - New Database query.

The wizard allows you to specify a filter on the menu that has 6
boxes.


You can acutally see the SQL statement when you get to the last menu
onin the wizrd (the one with finish) if you clcik the button edit query
and then press finish. You will see in the query editor the SQL button
(or in the menu).

The SQL is a string (or as VBA calls it Command Text) and you can
modify the string.


If you don't want to perform a query you can open the access database
using ADO or DBO methods and retrive what is call a recordset using the
SQL. You can look at the Access VBA help under ADO open, DBO open,
recordset, or SQL.

any Access VBA method can be used in Excel VBA if you delcar the
correct reference in Excel VBA menu -tools - Reference

The common references you use to get access data are


1) Microsoft Access 11.0 Library Object (or latest verision on your
PC)
2) Microsoft ActivedX Data Object 2.8 Library (or latest verision on
your PC)


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=147026

.