Don't use a macro, do some coding. Use the DoCmd.TransferSpreadsheet method.
mfG
--> stefan <--
Stefan,
Thanks for responding. I have also tried DoCmd.TransferSpreadsheet, but
again it returns ALL records not the filtered results. I'm not sure why this
is not working? At this point I have the following coding?
Private Sub cmdExcelExport_Click()
**ALL ONE LINE** DoCmd.TransferSpreadsheet acExport,
acSpreadsheetTypeExcel9, "qryRecordSearch", "C:\Documents and
Settings\vandj001\Desktop\SearchResults.xls"
End Sub
My search query (qrySearchDatabase) returns ALL records and by selecting
the criteria on my main form, I narrow down the results. I think my problem
lies in the fact that when I export it takes the query (qrySearchDatabase) AS
IS without the filter applied. How do I make sure that the filter gets
applied to the query BEFORE it exports?
> hi Justin,
>
[quoted text clipped - 9 lines]
> mfG
> --> stefan <--
Stefan Hoffmann - 15 Mar 2007 11:02 GMT
hi Justin,
> Thanks for responding. I have also tried DoCmd.TransferSpreadsheet, but
> again it returns ALL records not the filtered results. I'm not sure why this
> is not working? At this point I have the following coding?
This was not a good advice at all. The problem is, how to get your
filter information.
You can export
"SELECT * FROM qryRecordSearch WHERE " & Filter
mfG
--> stefan <--