Re: retrive sql filter

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



First try running the query, then saving it. I'd try several different ways
of running it and saving it first.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Nuno Guerra" <NunoGuerra@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:261DBCD5-0529-455E-80E7-25891753F21A@xxxxxxxxxxxxxxxx
I try it but i obtain an error:

Run-Time error '2046':
The command or action 'SaveAsQuery' isn't avaiable now.

...

"Arvin Meyer [MVP]" wrote:

Try:

DoCmd.RunCommand acCmdSaveAsQuery

Have a look at this for giving it a name:

http://www.tkwickenden.clara.net/codeex/96-99.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Nuno Guerra" <NunoGuerra@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E0E96E97-51AE-46A2-999E-FD2C501BA0B6@xxxxxxxxxxxxxxxx
Thanks for your colaboration. It looks fine to me. But how can I save a
filter and give it a name, by using code?

"Arvin Meyer [MVP]" wrote:

You'll need to save your filter and give it a name. You'll also need
to
give
the file a name. Open any code module, then choose help from the menu
and
type in: "OutputTo" for a list of all the arguments.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Nuno Guerra" <NunoGuerra@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E64D5969-E29A-4D77-8F6A-A8BD65796FA7@xxxxxxxxxxxxxxxx
Thanks, that works.
Althought, I forgot to mencion that I want to do that with code and
assign
it to a button. Or in a Macro.
How can I do that?

"Arvin Meyer [MVP]" wrote:

Using Tools ... Office Links ... Analyze with Excel will export the
results
of a filter in a form to Excel.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Nuno Guerra" <NunoGuerra@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:3C811952-7C20-436F-9762-4051F78D9A62@xxxxxxxxxxxxxxxx
I have a form based table where users can filter records by using
the
Access
toolbar or the right button mouse.
They asked me to add a button that exports the results to an
excel
sheet.
I know how to export any existing query or table to excel, but
how
can
I
export the records that users see when they aply some filters?

Is there a way to do that?

thanks.
NG











.



Relevant Pages

  • Re: Error when using calculated members in filters area
    ... Subcube is that if you write a subcube query, you will get the exact same ... I have no platform with Excel 2007 Beta 2 to test... ... The filter into the pivot table area generates a WHERE clause in the ...
    (microsoft.public.sqlserver.olap)
  • Re: Filter Query - export spreadshet
    ... filter various data and export the different sets of filtered data to ... The reason for this approach is because you cannot use a "parameter" query ... and then use it for the export to EXCEL. ... ' Get list of manager IDs -- note: replace my generic table and field ...
    (microsoft.public.access.forms)
  • Re: Filter Recordset, export records to Excel
    ... filter for each user, then send that data to the excel template, save ... Dim objSheet As Object ... > Not sure why you need to "loop through a query and filter out records based ...
    (microsoft.public.access.modulesdaovba)
  • RE: Query For Todays Date
    ... It seems that the filter in Excel 2007 can filter out Today's data easily. ... Select "From SQL Server" ... When I try to edit the Query, ...
    (microsoft.public.data.odbc)
  • Re: Filtering Via Form, and then Export
    ... I got both the excel and access exports working. ... The filter code goes into the Open event of the form if you ever need to do ... Allen Browne - Microsoft MVP. ... the detail rows were bound to, to a make table action query, and have ...
    (microsoft.public.access.queries)