Export subform to Excel

  • Thread starter Thread starter Charles D Clayton Jr
  • Start date Start date
C

Charles D Clayton Jr

A2K
I have a mainform with tabsheets on it. I have added a subform that
changes its recordsource depending on which tab is pressed. The
subform shows its information in a datasheet view. I was able to add
a combo box to sort the data for the user. What I am having a hard
time doing is figuring out how to take whatever data is in the subform
and send it to Excel. Everytime I do it, it sends the whole table
instead of whatever information is on the subform. Does anybody have
any bit of code to help?

Thanks,

Charles D Clayton Jr
 
Create a query based on the recordsource of the subform. Set the primary key
criteria in the query to the value on the subform. ie,
Forms!Name)fMainForm!NameOfSubform!NameOfPrimaryKeyTextBox.
 
Back
Top