exporting a subform to excel (1 Viewer)

k0r54

Registered User.
Local time
Today, 11:02
Joined
Sep 26, 2005
Messages
94
Hi,

I have a subform and on that form i have a button, with that button i want to export the contents of the form to excel. It is in datasheet view and just want to export it to a file.

When i load the sub form. I put the query in through a macro (for various reasons) which i think what is making it a little more complicated. I have done a macro which is set to outputTo but because the is no record source until it is loaded within the sub form, it is not exporting anything apart form the titles and #name.

Any ideas?
k0r54
 

alastair69

Registered User.
Local time
Today, 03:02
Joined
Dec 21, 2004
Messages
562
Have a look at "docmd.outputTo" in the access help files. This should do want you need, I would attach your code to the On Click Event.

Hope this helps, if not i will have a look at some more options so let me know.

Alastair
 

k0r54

Registered User.
Local time
Today, 11:02
Joined
Sep 26, 2005
Messages
94
Thanks Alistair

Cheers
k0r54
 
Last edited:

k0r54

Registered User.
Local time
Today, 11:02
Joined
Sep 26, 2005
Messages
94
Hi,

I was actually mistaken it is still only exporting the data from the ORIGINAL recordsource. Because i change it, i need it to pick up its new one?
 

k0r54

Registered User.
Local time
Today, 11:02
Joined
Sep 26, 2005
Messages
94
It's still not working :(

Any ideas?
 

Users who are viewing this thread

Top Bottom