Export a form to an Excel file

DJ_DEF_CON_1

Registered User.
Local time
Today, 09:39
Joined
Jan 1, 2003
Messages
40
I have a form based on over a dozen queries. There are 26 text boxes within this form all being populated by a Dlookup, Dcount etc. What I would like to do is somehow export the results of this form into an Excel file. I have a combo box that contains a month name e.g. "January". This combo box is used, in part to filter the results that go into this form. What I would like to do is press a button and extract all this data into a specific folder with the name being the "Month name.XLS" i.e. January.xls

I can extract everything manually by going to File ... Save as/extract. I just cannot seem to find a way to do this by pressing a button.

Any help any of you could supply would be greatly appreciated.

Thanks
 
I just figured out how to output a report to excel - so assuming it is similar for a form, then MAYBE this would work

DoCmd.OutputTo acOutputForm, name of form, acFormatXLS, path to excel doc, 0

the other command you could look at is DoCmd.RunCommand acCmdOutputToExcel

Hope this is useful!
 

Users who are viewing this thread

Back
Top Bottom