On the same form where you put this command button for your user, put a pair
of text boxes named (say) StartDate and EndDate. The user can enter the
dates there, and the query can read the dates from the form and perform the
export.
The Criteria in your query would change to:
Between [Forms].[Form1].[StartDate] And [Forms].[Form1].[EndDate]
Hint: Set the Format property of the text boxes to Short Date, so only valid
dates are accepted, and Access knows how to interpret them.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"newkid" <mt*******@yahoo.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>I have a query q401k which has parameter [Start Date] and [End Date]. I
need the recordset of the query to be exported to a .csv file. Does
anyone know how to do this?
I am currently using a macro to automatically send it to Excel. In
Excel I have a macro that formats and saves it as a .csv file. The
user has to click a button in the Excel spreadsheet to run the macro.
I am trying to automate it so she doesn't have to anything but click a
cmd button in Access.
Thanks