Hi,
I have 2 linked databases. I have information dumped from one of the databases and put into the other at the end of the week. The information in the first database is then deleted, so the next crew coming on has an empty database. I have this code for my tables, it works for the rest of them, but not this one.
my tables are linked properly and table names are correct. I would just like to know if my information is being just deleted or if is being put somewhere. I have looked in the actual database (i:\new\all.mdb) and the info is not there. yet, this works for all the other tables. -
strAppend1 = "INSERT INTO [concentrate cans1] SELECT * FROM [concentrate cans]"
-
strAppend1 = "Delete * from [concentrate cans]"
-
DoCmd.RunSQL strAppend1
-
Andrew
4 1201
Hi,
I have 2 linked databases. I have information dumped from one of the databases and put into the other at the end of the week. The information in the first database is then deleted, so the next crew coming on has an empty database. I have this code for my tables, it works for the rest of them, but not this one.
my tables are linked properly and table names are correct. I would just like to know if my information is being just deleted or if is being put somewhere. I have looked in the actual database (i:\new\all.mdb) and the info is not there. yet, this works for all the other tables. -
strAppend1 = "INSERT INTO [concentrate cans1] SELECT * FROM [concentrate cans]"
-
strAppend1 = "Delete * from [concentrate cans]"
-
DoCmd.RunSQL strAppend1
-
Andrew
It sounds like you need this in VBA, and I could be way off base here. But if this is the case, please hang on, will fetch it and load and you can if can it be used...
Here we go rudeman76: http://www.thescripts.com/forum/thread743450.html -
-
Option Compare Database
-
-
Sub RunMultiSQL()
-
-
DoCmd.SetWarnings False
-
-
DoCmd.RunSQL ("UPDATE Data_Central SET Active = True WHERE ContactDate Is Not Null And OpenDate Is Not Null And CloseDate Is Not Null ")
-
-
DoCmd.SetWarnings True
-
-
End Sub
-
What I did was I set it to fire when Form_Loads, the query then runs. UPDATE can be DELETE in your case
(1) Active is a checkbox, you can turn that field to your textbox if you want
(2) ContactDate, OpenDate, and CloseDate are textboxes...
Come to think of it, it may be better handled as: -
-
Option Compare Database
-
-
Sub RunMultiSQL()
-
-
DoCmd.SetWarnings False
-
-
DoCmd.RunSQL ("UPDATE Data_Central SET Active = True WHERE ContactDate Is Not Null")
-
-
DoCmd.RunSQL ("UPDATE Data_Central SET Active = True WHERE OpenDate Is Not Null")
-
-
DoCmd.RunSQL ("UPDATE Data_Central SET Active = True WHERE CloseDate Is Not Null ")
-
-
DoCmd.SetWarnings True
-
-
End Sub
-
I believe this is what I have in my db now, thought to have read it works better. Please try it, and good luck with the project:-)
Dököll
hey,
I may not have been clear. My delete statement works fine, its the Insert part I am not sure about. I am trying to use insert to take the data from my "concentrate cans" table and put it into "concentrate cans1" table. The code works fine for 6 other tables, but for some reason it does not work with this one. It is supposed to take the info from the first table and put it into the second. I have this set up to activate with a log out button. The delete is working fine, cause the table is empty at the end of every week, but when I go back to look to see if the information is in the 'master' DB, I cannot find it.
I hope this is more clear and makes sense,
Andrew
I feel real stupid right now,
I was missing one line.
[code]
DoCmd.RunSQL strAppend1
[/code}
this should have been right after the first line.
thanks for all your help though, I really appreciate it,
Andrew
Sign in to post your reply or Sign up for a free account.
Similar topics
by: cody |
last post by:
Why isn't there an StringBuilder.Append() overload with a StringBuilder as
argument?
Is there a reason that I missed?
|
by: Yves Glodt |
last post by:
Hello,
if I do this:
for row in sqlsth:
________pkcolumns.append(row.strip())
________etc
without a prior:
|
by: Jonathan Buckland |
last post by:
Can someone give me an example how to append data without having to
load the complete XML file.
Is this possible?
Jonathan
|
by: JMCN |
last post by:
hi-
i have inherited an access 97 database that keeps track of the loans.
i have been running into referential intergrity problems when i try to
append new loans to table.
first of all is a...
|
by: David Barger |
last post by:
Greetings,
It appears that an Append Query I run in Access XP is randomly failing
to append a field.
I have payroll data being entered into a payroll database. This data
is exported daily to...
|
by: Michael C via AccessMonster.com |
last post by:
Hello,
I have a table that I am appending 3 seperate tables into. My main problem
is that each time I append the data, it simply adds to the data already there.
That might sound ok, except that...
|
by: audleman |
last post by:
I have an ASP form on my website where a visitor enters information. On
submit, the form calls a stored procedure stores in a MS SQL 2000
database. The stored procedure works most of the time, but...
|
by: John Salerno |
last post by:
If I want to create a list of the form
(where each item is repeated twice after the first one), how might I do
that most efficiently?
Right now I have this:
series =
for x in range(10): ...
|
by: jeremito |
last post by:
I have created a class that inherits from the list object. I want to
override the append function to allow my class to append several
copies at the same time with one function call. I want to do...
|
by: HYRY |
last post by:
I have the following questions, I am using Python 2.4.2
19167152 #1
11306608 #1
1. the address of a.append and list.append is different, can I get the
address of...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
|
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...
| |