retrive sql filter

N

Nuno Guerra

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
 
A

Arvin Meyer [MVP]

Using Tools ... Office Links ... Analyze with Excel will export the results
of a filter in a form to Excel.
 
N

Nuno Guerra

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?
 
N

Nuno Guerra

Thanks for your colaboration. It looks fine to me. But how can I save a
filter and give it a name, by using code?
 
N

Nuno Guerra

I try it but i obtain an error:

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

....
 
Top