473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Export CSV and update column with Now()

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

Aug 10 '06 #1
3 3200

Help file anyone?

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

Aug 11 '06 #2

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

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

pi********@hotmail.com wrote:
Help file anyone?

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

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

Aug 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Dave | last post by:
I have 2 tables, one with names, and another with addresses, joined by their CIVICID number (unique to the ADDRESSINFO table) in Oracle. I need to update a field in the NAMEINFO table for a...
8
by: Lauren Quantrell | last post by:
In VBA, I constructed the following to update all records in tblmyTable with each records in tblmyTableTEMP having the same UniqueID: UPDATE tblMyTable RIGHT JOIN tblMyTableTEMP ON...
1
by: bburton | last post by:
I'm using a form in Access which was used as a bug tracker. The users could update the record with an attachment. (The data type of the field that is used for attachments is the OLE Object) I...
5
by: Maria L. | last post by:
Hi, I need to export the content of a DataGrid (in Windows application in C#), into an Excel spreadsheet. Anyone knows how to do this? Any code snippets would help! thanks a lot, Maria
8
by: Taffman | last post by:
I've searched this goup for an answer to this, there are many discussions that come close but non that I can find that actually addresses this particular problem. I'm exporting queries to Excel....
1
by: sal21 sal21 | last post by:
I use this code to update a sql database from excel to sql... Now i would want to arange this code to export an Access table into sql databse... Sub ADOExcelToSQLServer() Dim Cn As...
5
by: no_spam_for_gman | last post by:
I have been using the export command for quite some times to export comma delimited file. I have always been looking at how to generate the first row with the column header but never found a clean...
5
by: seddy | last post by:
Hello ! I`m kinda new to it so I found this `job` very hard therefor I ask for Your help. So, the thing is... I have this XML file ( http://www.izishop.net/export.php ) which I need to open...
1
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.