Extract subform into excel

Joy83

Member
Local time
Yesterday, 18:29
Joined
Jan 9, 2020
Messages
116
Hi all,
I have two subforms in one main form
Once you click on a field in subform1 it filters the results in subform2
I want to extract the resulted data in subform 2 in excel as is (as showing in the form)

i tried many things but it didn’t work. Can you plz help
 
Hi. Have you tried using the CopyFromRecordset method?
 
thanks for your reply
Can you refer me to a link I didn’t try this method
I was trying transferspreadsheet and outputto
 
This line is working fine except it brings all the subform (not the filtered one)
What to put instead “?” To make it transfer only the filtered data in the subform
DoCmd. Outputto ac outputform, ? , acformatxlsx
 
here is a demo.
if you need to adopt to your db, copy the 3 modules.
 

Attachments

Use a query to export the data. In the query, use a WHERE clause that references the first subform.

WHERE SomeField = Forms!yourmainform!yourfirstsubform!SomeField
 

Users who are viewing this thread

Back
Top Bottom