export data from form to an excel spreadsheet

mrbebop

Registered User.
Local time
Today, 13:33
Joined
Jun 6, 2003
Messages
32
What is the code that would have a command button export all the data from a form to an Excel Spreadsheet. The users do not have the option to choose "File" and "Export" the data from the form. I am just assuming that a command button is the best way to do this. If a macro would be better, then how would I do that? I don't know VBA or macro's. Thanks for your help.:)
 
If you dont know any VBA then your a bit limmited


Open up your form and go to [FILE] in the menu, there is a [Export] option click this; one of export options is to use excel.

the excel export isnt very good tho.






:cool:ShadeZ:cool:
 
You will need to create a cmd button and use the following code


DoCmd.OutputTo acForm, "Form2", "Microsoft Excel (*.xls)", "c:\fred.xls", True, ""

think that should work but not sure

Steve
 
indesisiv said:
You will need to create a cmd button and use the following code


DoCmd.OutputTo acForm, "Form2", "Microsoft Excel (*.xls)", "c:\fred.xls", True, ""

think that should work but not sure

Steve


Its just a way in VBA code of using the export option located in the menu.
 
The users do not have the option to choose "File" and "Export" the data from the form

you can use a macro to do the same thing if it is easier for you.

ust the outputTo
it is fairly self explanitory after that.

Steve
 
The users do not have the option to choose "File" and "Export" the data from the form

Doh!!:rolleyes:

Didnt c that i must be going blind...............................
 
Thanks!!!

Thanks everybody! I can do the DoCmd and the button, but for my information could you explain the command so that I can understand what it is doing and also would you get me started on the macro (for learning puroses)? I appreciate your help!
 
1st the docmd is the VBA root not the macro root, which is it you want to do.

[Edit]

as for finding out how the functions work and what they do i sugest looking in the help, its very informative and contains info on every function of access.

[/Edit]
 
Last edited:

Users who are viewing this thread

Back
Top Bottom