Export Subform Filter to Excel

accessNator

Registered User.
Local time
Yesterday, 22:29
Joined
Oct 17, 2008
Messages
132
I know that this question has been asked many times, but I can't seem to find the proper solution.

My subform is filtered via using VBA.

e.g.
Code:
strFilter = "[FK_D_TO_ID] = " & passProgram & " AND [isPending] = " & Me.txtIsPending & " AND [isApproved] = " & Me.txtIsApproved 
Me.sfrmContainer.Form.RecordSource = "qry_WorksheetFund_Status_TollFree"
Me.sfrmContainer.Form.Filter = strFilter
Me.sfrmContainer.Form.FilterOn = True
It works as I expect to see in my Subform.
Now I want to export the results out to excel.

The problem is that I want to only export what is actually being viewed on the subform. Not the underlying query that it uses which has many more columns that are not displayed on the subform.

Is this possible?

Better yet, is it possible to use the result being displayed on the subform and make that into a temporary table and export that to EXCEL?


Thoughts?
 
Not sure how this would work with a subform, but I had a database that used this function to export the current form contents to Excel:

Application.RunCommand acCmdExportExcel
 
Not sure how this would work with a subform, but I had a database that used this function to export the current form contents to Excel:

Application.RunCommand acCmdExportExcel

Thanks for your reply, but I am not sure how to use this.
 
You would put this in a command button or something to trigger the export.
 

Users who are viewing this thread

Back
Top Bottom