exporting a queried form to Excel

P

pat67

Hi all. I have a form that filters for certain criteria. I have code
to run a filtered report, however I am unable to export directly to
Excel. When I try, the entire table is exported. Can someone help
please?

Thanks
 
J

Jeff Boyce

If you'll apply the same criteria you use in your filter to a query, you can
then export that query to Excel.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
P

pat67

If you'll apply the same criteria you use in your filter to a query, you can
then export that query to Excel.

Regards

Jeff Boyce
Microsoft Office/Access MVP







- Show quoted text -

Ok. I am not sure how to do that.
 
J

Jeff Boyce

Create a query.

Use the same selection criteria you used when you filtered your form.

Save the query.

Export the query.

Regards

Jeff Boyce
Microsoft Office/Access MVP

If you'll apply the same criteria you use in your filter to a query, you
can
then export that query to Excel.

Regards

Jeff Boyce
Microsoft Office/Access MVP







- Show quoted text -

Ok. I am not sure how to do that.
 
P

pat67

Create a query.

Use the same selection criteria you used when you filtered your form.

Save the query.

Export the query.

Regards

Jeff Boyce
Microsoft Office/Access MVP






Ok. I am not sure how to do that.- Hide quoted text -

- Show quoted text -

I know i can just create a query. what I am trying to do is create the
query from the form any time i change any criteria. In other words
create the query on the fly. I want how the form is filtered to be the
filter criteria for the query.
 
J

Jeff Boyce

Here's a variation on your theme...

Instead of using find/filtering on your form, use a "criteria" form to allow
the user to specify their search/find/filter criteria. Then dynamically
create a query (a query is just a SQL statement, after all) behind a button
click that reflects the criteria set/selected on that form.


Regards

Jeff Boyce
Microsoft Office/Access MVP

Create a query.

Use the same selection criteria you used when you filtered your form.

Save the query.

Export the query.

Regards

Jeff Boyce
Microsoft Office/Access MVP






Ok. I am not sure how to do that.- Hide quoted text -

- Show quoted text -

I know i can just create a query. what I am trying to do is create the
query from the form any time i change any criteria. In other words
create the query on the fly. I want how the form is filtered to be the
filter criteria for the query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top