Filtered Access Form to Export

  • Thread starter Thread starter Michael Kintner
  • Start date Start date
M

Michael Kintner

How can I take the current filtered form, press a button and the filtered
data shown in the form appears in Excel. I have experimented with
transfersheet, plus a couple of other methods with no luck. I need to start
from the beginning.

Can anybody give me a hand for I am in a jam I am. (smile)

Thank you in advance and Happy Holidays,
Michael
 
Michael:

One alternative would be to use the Excel CopyFromRecordet method to copy
the data from the form by using automation. For example:

Private Sub Command5_Click()

Dim xl As New Excel.Application
Dim wkb As Excel.Workbook

Set wkb = xl.Workbooks.Open("C:\TestBase.xls")
wkb.Worksheets("Sheet1").Range("A1").CopyFromRecordset Me.Recordset

wkb.Close True
xl.Quit

Set wkb = Nothing
Set xl = Nothing

End Sub

The form recordset holds all the fields in the table or query bound to your
form, not necessarily the fields shown on the form. Depending on your
needs, you may need to adjust the form Record Source. You will need a
reference to the Excel Object Library, of course.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


How can I take the current filtered form, press a button and the filtered
data shown in the form appears in Excel. I have experimented with
transfersheet, plus a couple of other methods with no luck. I need to start
from the beginning.

Can anybody give me a hand for I am in a jam I am. (smile)

Thank you in advance and Happy Holidays,
Michael
 

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

Back
Top