Connecting Tech Pros Worldwide Forums | Help | Site Map

Export CSV and update column with Now()

John Graham
Guest
 
Posts: n/a
#1: Aug 10 '06
I thought this would be easier, however I seem to be struggling with
this.

I'd like to create a command button that will look at a certain query I
have created and export the records as a csv file, and also update a
field called dateModified to Now(). That way the next time I run the
query, it looks for null records in dateModified and only executes
records that have not been processed.

I've seen two approaches mentioned. TransferText, and output file in
VBA. I'm fine with either, just need to find a good example.

John


pietlinden@hotmail.com
Guest
 
Posts: n/a
#2: Aug 11 '06

re: Export CSV and update column with Now()



Help file anyone?

docmd.transferText acExport, queryName, "C:\filename.csv"
currentdb.execute "UPDATE MyTable SET dateModified=Now WHERE
dateModified IS NULL;"

John Graham
Guest
 
Posts: n/a
#3: Aug 11 '06

re: Export CSV and update column with Now()



Thanks, got me started.... we must have different versions.

I had to use
DoCmd.TransferText acExportDelim, , "QUERYNAME", "c:\export.csv

pietlinden@hotmail.com wrote:
Quote:
Help file anyone?
>
docmd.transferText acExport, queryName, "C:\filename.csv"
currentdb.execute "UPDATE MyTable SET dateModified=Now WHERE
dateModified IS NULL;"
pietlinden@hotmail.com
Guest
 
Posts: n/a
#4: Aug 11 '06

re: Export CSV and update column with Now()



John Graham wrote:
Quote:
Thanks, got me started.... we must have different versions.
Nope, I have senility and was doing it from memory.

Closed Thread


Similar Microsoft Access / VBA bytes