Discussion Locked

Open Access Qry in Excel Cmd Button

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have an Access form from which I need to open a different Query in Excel. How do you do that?

I know how to open tables, queries, spreadsheets or documents with a command button, but how do you open a query in excel the way you can with the menu item "Tools, Office Links, Analyze It with Excel".

3 replies

by john.a.wills

Link the Excel file to the Access database using ALT F/Get External, then address it as though it were an Access table.

by atswork

That is a good idea. But I think I failed to clearly state my problem. I needed to get the data on my panel into an excel file and I've since figured it out. Here's the code:
DoCmd.OutputTo acOutputForm, "subfrm_ASSIGNED_DEFAULTS", _
acFormatXLS, "6000003_TARGET_DATA_ALL.XLS", True

This discussion is closed to new replies.