Export Data From A Form To Excel

bifteki

Registered User.
Local time
Today, 23:20
Joined
Oct 24, 2008
Messages
23
I have a subform in a larger form, for which the recordsource is given
through code by a string I make using the user's entry in a text box. I want
to export this data to excel but I don't know how.

To be more specific, we often have to make excel files that contain all
persons that have a specific first name (in Greece we value high our name
days, so we use this for PR, to send our wishes to customers or potential
customers). By pressing a button a pop-up form shows up that contains six
text boxes (in many name days, more than one name is celebrated) were you can
specify up to six strings, either of which must be contained in the person's
first name. When you press another button, "Search", the recordsource of the
main form's subform is set as a string I create in code, so the results show
up (company name, person name & suname etc.).

Is there any way I can export this data to excel?
Maybe I could use docmd.outPutTo? The problem is "docmd.outPutTo" 's use is a
bit limited -as far as I have come to understand- as there are only a few
object types you can export (stored procedure, table etc.).
 
Sounds like you want DoCmd.TransferSpreadsheet
 
How could I use it in this case? I don't want to export from a stored query or table. The data I want to export exists in the form of the subform's recordset.
 

Users who are viewing this thread

Back
Top Bottom