exporting subform data

  • Thread starter Thread starter Greg C
  • Start date Start date
G

Greg C

How do I write code to export (outputto) data in a current subform? I have
tried to setfocus on the subform control, but it still wants to export the
main form data. IS there a way to do this or do I have to write a different
query/form to manage it.
Current code

Forms![School Information Sheet].chaptersub.SetFocus
DoCmd.OutputTo acOutputForm, , , , yes

School Information sheet = main form
chaptersub = subform control
 
Thanks - I have ended up setting up a query and exporting that - however, I'd
like to get this to work with a subform.
I tried what you suggested yesterday, but I can't get it to recognize
chaptersub as a form - it keeps thinking its a field and a get an error. I
have tried referring to the sub in this manner

Me!chaptersub.form
or
Forms![School Information sheet].chaptersub.form

But still no good results.

Any ideas?
--
greg


bhicks11 via AccessMonster.com said:
Hi Greg,

I would try

DoCmd.OutputTo acOutputForm,chaptersub , , , yes

and if still not working correctly I would export the query or table:

DoCmd.OutputTo acOutputTable,whateverisonsubform , , , yes

Bonnie
http://www.dataplus-svc.com

Greg said:
How do I write code to export (outputto) data in a current subform? I have
tried to setfocus on the subform control, but it still wants to export the
main form data. IS there a way to do this or do I have to write a different
query/form to manage it.
Current code

Forms![School Information Sheet].chaptersub.SetFocus
DoCmd.OutputTo acOutputForm, , , , yes

School Information sheet = main form
chaptersub = subform control
 
Back
Top