Export subform to Excel

  • Thread starter Charles D Clayton Jr
  • 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
 
P

PC Datasheet

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.
 

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

Top