Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Analysing with Excell from a form using a command button 1

Status
Not open for further replies.

Modex

Programmer
Sep 15, 2002
155
GB
Good Morning all,

I have a little problemette which I cannot wrap my head around and wondered if anyone could possible help.

Basically I have a form that looks very much like a table view, it has six columns and 6 combo boxes, each combo box above each column allows the user to select a field, so when all 6 combo boxes have been selected, then the form would be fully populated with the selected fields.

What I would now like the user to be able to do, is to click a command button to access the results on the screen to a spreadsheet. This works fine if I use Tools / Office Links / Analyse with MS Excel.

But how to get the forms contents to a spreadsheet via a command button has got me completely lost.

I have tried using:-

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Selecta", "c:\DexExtract.xls", True

However where “Selecta” is the name of the form, it is not accepted and I cannot use the underlying table or query as the user has specific fields selected and may have used filters.

Any help would be gratefully received

Many thanks

ModeX
 
Have you tried the DoCmd.OutputTo method ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV

I didnt know that one, Just tried it and it works a treat.

Many many thanks


ModeX

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top