Export query with form parameters to .csv file

skwilliams

Registered User.
Local time
Today, 06:44
Joined
Jan 18, 2002
Messages
516
I'm not sure if this is the right forum to post this question but.

I have a table with particular data that I want to export to a comma delimited file. The parameter values may vary daily.

I have a query which utilizes parameters from a form tied to a table so the parameters are stored. I'm viewing the query from within this form as a subform and it's working great.

Now the problem. I want to take these query results and export to a .csv file. I've tried this code
Code:
Private Sub btnProcessSamples_Click()
DoCmd.TransferText acExportDelim, , "qrySampleExport2", "G:\PODRiso\Sample Lists\Samples\Samples.csv", False
End Sub
, but it asks for the parameters already provided by the form. If I replace the query name with the name of the subform, I get this error.
Run-time error '3011'
The Microsoft Access database engine could not find the object 'subfrmSampleExport2'. Make sure the object exists and that you spell its name and the path name correctly.

Any ideas?? :confused:
 

Users who are viewing this thread

Back
Top Bottom