exporting subform data

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
 
B

bhicks11 via AccessMonster.com

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
 
G

Greg C

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
 

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