Link to home
Start Free TrialLog in
Avatar of a260148
a260148Flag for United States of America

asked on

Analyze it with Excel

Hello,
I would like the ability to add this to a form on a button click. I know of the "output to" and the "transfer spreadsheet", but i have a form that is datasheet view with 3 subforms in datasheet view, and I would like it to export to excel with those subforms grouped in (with the plus sybols for expanding records... just like in datasheet view.
Any help is much appreciated.
Thanks
Avatar of a260148
a260148
Flag of United States of America image

ASKER

Another point to add is that my recordset has to many records to use "output to"... and i can't use transfer spreadsheet unless it's a table. It would be great if their was a docmd.menu item... etc for the "analyze it with Microsoft Excel".
Thanks
Avatar of Rey Obrero (Capricorn1)
try this

Private Sub cmdAnalyze_Click()

CommandBars("Menu Bar").Controls("Tools").Controls("Office Links").Controls("Analyze It With Microsoft Office Excel").accDoDefaultAction

End Sub
Avatar of a260148

ASKER

run-time error 5 - invalid procedure call or agrument

huh...

just tried it with the Northwind database Orders form and it is working.
Avatar of a260148

ASKER

i have the dbwindow hidden... think that may be it?
Avatar of a260148

ASKER

Ok, i unhid the window and it does give me the option now, but when I export... it only grabs the main form, which is just a few textboxes... i need it to grab the subforms and such??
check the record source of  your form, subform .

i believe it will only export to excel the record source of the form.

check the Northwind Orders form, the record source Orders Qry is the one being exported to excel
ASKER CERTIFIED SOLUTION
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial