robhargreaves
Registered User.
- Local time
- Today, 00:39
- Joined
- Mar 4, 2005
- Messages
- 11
Hi I need to output myself a csv file of all information since the procedure was last run (i.e - any new data since the last export to csv was done)
I have created an unlinked table to just contain a single value in a single row holding the date. For the first ever press because there will be no date pre entered i will have to say if null export all data in the csv, this would then have to be updated in the code but I dont know how to write to it when an event happens.
I know what data I need to export and I have a query which will collect this information for us. I dont know how to specify the qry name although my querie is called qryexportcsv
This is the code I have found on this site which is similar.
dim AString as string
Dim rst as dao.recordset '
Set rst = currentdb.openrecordset("qryexportcsv")
aString = rst![YourField] ' I dont know what this line does?????
set rst = nothing
docmd.TransferText acexportdelim,"SpecName","TableName","C:\Test" & AString & Format(date,"YYYYMMDD") & ".csv"
I think the filename is how I want it (20051212.csv????) but I need the location to always be the desktop can you help me do this?
Thanks
I have created an unlinked table to just contain a single value in a single row holding the date. For the first ever press because there will be no date pre entered i will have to say if null export all data in the csv, this would then have to be updated in the code but I dont know how to write to it when an event happens.
I know what data I need to export and I have a query which will collect this information for us. I dont know how to specify the qry name although my querie is called qryexportcsv
This is the code I have found on this site which is similar.
dim AString as string
Dim rst as dao.recordset '
Set rst = currentdb.openrecordset("qryexportcsv")
aString = rst![YourField] ' I dont know what this line does?????
set rst = nothing
docmd.TransferText acexportdelim,"SpecName","TableName","C:\Test" & AString & Format(date,"YYYYMMDD") & ".csv"
I think the filename is how I want it (20051212.csv????) but I need the location to always be the desktop can you help me do this?
Thanks
Last edited: