473,479 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Supress Update Records Question - Answer Yes?

misscrf
13 New Member
I have put this code together (from various posts on the web and the help file...)

It loops through a folder of CSVs and imports them into a table, updating a column with the file name. What I am stuck with is that it asks me Yes or No do I want to update the records for the update part. Anyway I can get it to just answer yes?

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Command0_Click()
  3. Dim strDocPath As String
  4. Dim strCurrentFile As String
  5.  
  6. strDocPath = "O:\ProjectShare\123456 Project\test\"
  7. strCurrentFile = Dir(strDocPath & "*.csv")
  8.  
  9. Do Until strCurrentFile = ""
  10.  
  11. DoCmd.TransferText acImportDelim, "myspecs", "tblCSV", strDocPath & strCurrentFile, -1
  12. DoCmd.RunSQL "UPDATE tblCSV SET tblCSV.FileName =  """ & strCurrentFile & """ WHERE tblCSV.FileName Is Null"
  13. strCurrentFile = Dir
  14. Loop
  15.  
  16. End Sub
  17.  
Thanks!!!
Feb 5 '09 #1
3 1191
ChipR
1,287 Recognized Expert Top Contributor
DoCmd.SetWarnings False

You should set it back to True after you are done though.
Feb 5 '09 #2
misscrf
13 New Member
Thanks! this is all I needed. I kind of feel stupid for not thinking of it. I think I just wasnt sure how it would know I wanted yes and not no.
Feb 5 '09 #3
ChipR
1,287 Recognized Expert Top Contributor
Don't feel bad, I still remember looking for the answer to the same question myself. Who's going to read all the functions of DoCmd?
Feb 5 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4512
by: LRW | last post by:
I'm creating a simple reply form, and if a form item isn't answered I get an error: "Notice: Undefined index: rb_amntspent in c:\inetpub\wwwroot\mackinaw\survey.php on line 36" even if in the...
33
4234
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
9
4275
by: Geraldine Hobley | last post by:
Hello I'm getting the above mentioned error in my applicatio I have a datagrid bound to a datasource like s MyDatagrid.DataSource = Mydataset.Tables(Order) - this all works fine However I...
3
1498
by: Yakimo | last post by:
Hi I am trying to append some records form tmpSource to tmpDest table using datasets Tables tmpSourec and tmpDest are identical. My setup is the following: - daSource - data adapter for...
5
5552
by: Louis LeBlanc | last post by:
Hey folks. I'm new to the list, and not quite what you'd call a DB Guru, so please be patient with me. I'm afraid the lead up here is a bit verbose . . . I am working on an application that...
1
2112
by: Jack | last post by:
Hi, I got a test asp page which connects to Northwind.mdb database. This page pulls all the rows from the Customers table. One column i.e. GoodStatus has been added to the customers table. The...
16
3458
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
7
1855
by: bbasberg | last post by:
Hello, I thought I would do a "sanity check" by asking the experts how to do the following: I need to process external data (it will be in an Access DB table and will be updated daily) into a...
1
2164
by: psuaudi | last post by:
I’m using a vb.net app that opens a powerpoint presentation and calls the updatelinks function of powerpoint. One slide in the presentation is linked to a cell range in an excel file, and the...
0
6899
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7067
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...
1
6719
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5312
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4463
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2970
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
166
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.