Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting filtered datasheet subform to excel

Status
Not open for further replies.

mdex

Technical User
Nov 28, 2011
10
GB
Afternoon all,

Looking for a little guidance.

I have a from that is used to filter data in a subform. The subform shows in datasheet view and my filters work ok.

I have the following code to export the form to excel but it exports all records rather than the filtered results.

DoCmd.OutputTo acOutputForm, "subsearch", acFormatXLS, _
"\test.xls", True

Any ideas?

Thanks in advance.
 


hi,

So do you expect to make a bunch of Excel workbooks, each one for a different set of filter results?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Mdex,

Personally I havenot used docmd.outputTo. Instead I use DoCmd.TransferSpreadsheet

My inlination whould be to grab the filter from the subform and use it for exporting the data.
 
There will be 3 or 4 people who will use the filter and export functions, each wanting at any one time slightly differing information.

I'm still very new to access/vb after not using it for about 10 years so not up to speed yet. Couldn't get DoCmd.TransferSpreadsheet to work.

Would it help if I posted my filter code?
 

Here's what I am asking.

Are these people in access and working there, spinning off workbooks to send to gazillion other people, but mainly working in Access?

Or is the objective to get the filtered data into Excel and then work in Excel for a while with this data, mainly working in Excel?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Sorry,

They are only working in access to get the data out then manipulating it in excel.
 
I believe Skips next thought is why not setup the Excel document to retrieve data from Access instead of having Access dump the data? Then the user can make whatever formula change etc. and then only have to refresh the data from Access.
 


Exactly!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top