Append/delete Queries
Sep 23, 2007
I got these two append and delete queries in my database that i want to run on startup. I was wondering if there is a way to not have the msg that pops up to ask if you are sure you want to append/delete 0 record to table if there isn't any record that matches the condition set. I'm sure there is a way because if there isn't any record that matches the condition set in the queries then i don't want to have to click "No" everytime the database starts.
thanks,
Vincent
View Replies
ADVERTISEMENT
Sep 4, 2005
I am accessing an oracle database that has several thousand records in it. I am quering for specific requirements, but would like to save my query results in a local access database for faster searching capabilities. Is there a way for me to set up a query that will go out to my oracle table files, select the records that pertain to my search criteria, and add records to locally stored tables without duplicating itself each time that I run the query? I would appreciate any assistance in this matter. Thanks for your help!
View 1 Replies
View Related
Mar 27, 2013
I am creating a database where the records of individual students are to be moved to different table depending on where they are in the graduation process. In order to do this, the secretary will enter the student in the "90 Hr Request" table (think of it as the first step), and move them down the line of tables (4 in total) until the final "Completed" table. Each table in the progression has more and more fields. However, a student (with their ID number as the primary key) can only be in one table at a time.
I understand this does not sound like a traditional database, as the data is not normalized. However, this is being used more as a filing system than anything else. Their data is primarily paper based (for legality reasons), but wishes to keep it organized in a database so they can run queries and print reports.
Currently, I am creating a macro that will run specific queries (in an order). I have made an append query that will move the records over, then I used a update (to null) and delete query combo to delete the old individual record. I made the delete + update query work by using a selected criteria.
How to make the append query move only one student's record at a time.
View 2 Replies
View Related
Aug 19, 2004
I have a macro setup that deletes all the records in 2 different tables, then using about 8 queries, appends several records to the two tables where data was deleted. When these macros run, several Yes/No/Cancel dialog boxes come up for each query, first asking you if you are sure you want to do this, that it is going to change data in my table, and then second telling me how many records it's going to append or delete.
Is there a way to make it automatically run Yes to all of these dialog boxes? That would really help out a whole lot. Of instead of that, but maybe some sort of VB code that could do all the deleting and appending without the need of the Macros, and that doesn't require user intervention. I have my Macro's setup on the "On Click" event in a form, so using VB would be no problem at all.
Any Suggestions?
View 10 Replies
View Related
Jul 1, 2015
I have a Table1 served by Form1..It is a list of: UnqID, process, quantity, totaltime(in seconds).I want to click on a record to bring up a filtered Form2 with the chosen record on it.What I want to be able to do is to now split the quantity (and the time) and put these new records back into Table1 and delete the original record
EG
ID1,10,write a report,2400
I want to delete this and replace it with two (or three/four etc) replacements, but still adding up to 10 quantity and 2400 seconds so that the new data could be:
ID2,5,write a report,1200
ID3,5,write a report,1200
My initial thoughts are to create a holding table to:Append filtered data on Form2 to a holding Table1hld (i don't know how to do this) delete data in Table1.then enter the new quantities into a holding Table2 (that I will input myself) and then append (through a series of queries back into Table1).The first problem is how to append (and subsequently delete) the filtered record from Form2 to Table1hld.
View 1 Replies
View Related
Jun 11, 2014
I have a table called "EquipmentRequired" which is populated by 4 append queries,
5000BaseReq, 6000BaseReq, 6000IFBBReq, EquipmentReq which get some of their information by counting fields in another table but all have the same field names.
The queries contain all data that is initially used to append new records to the table and this works fine.Unless some information changes or a record is added then I would like to add a button to a form and call it "update equipment" behind which would run a vba code firstly to delete all the records in "EquipmentRequired" table then run the 4 queries without the warnings and re-populate the table.
View 9 Replies
View Related
Dec 27, 2006
Hey everybody,
Admittingly I last did a query like this 4years ago and I know there is a simple way of doing it, but I have completely forgotten!
My problem: I am wanting to create a query which will automatically detect if a customer has NOT made an order in a period of twelve months (a customers details/orders are stored in the database: tables customer and tables order). Those who have not made any orders in 12months can be deleted (the option should be to delete them not automatic deletion.
I want the query to delete (if it is selected) all traces of that customer including their orders.
I tried creating the query and using the date function: <Date()-365, however, I want to make sure it will work.
Thanks and I hope people can help!
View 2 Replies
View Related
Oct 24, 2006
I need to append some rows into a table, before I add these rows i need to delete all of the old rows.
I can't use a Make Table query because I am updating a linked table in another database.
So how can I (automatically) delete all rows in that table before or during the append process.
Thanks
Steve
View 2 Replies
View Related
Jul 26, 2007
I am trying to run a query that appends data into a table.. however, the way im setting it up.....lets say i have a table named Accouts, and under accounts there is #1 to 30. When I try to add a new account through a form, and append it to that, it takes the 31 there nwo are after i added one, and adds it to the 30 alraedy there, creating 61 instead of 31. is there anyway i can take into account for duplicates when im creating a query. im new to databasing, just got stuck with this assignment for the summer, and have no idea what im doing :( and i dont have time restart after learning normalization. i wish i did, but i dont. if it works it works, thats the bottom line. thanks everyone.
View 2 Replies
View Related
Jun 9, 2005
I have 2 databases which are mirror images of each other. one db is named rent and the other is named renthistory. in the db i have 2 tables, tblcustomer and tblradio. i would like a button on my form to append the current record to the renthistory db and then delete the current record. how can i do this?
Thanks in advance!
Tim
View 2 Replies
View Related
Jun 23, 2005
Sorry, I really couldn't think of a solid title for this. I'll try and explain and provide some code as well.
I've got a series of tables, one of which is linked to a Mobile Device. I have a query (herein called Query A) that queries a masterfile, named MasterFileEdit, based on selections the user makes on the front end. Query A then returns the results, sorted by section number. Query B is set up to query based on the same selections, but instead DELETE all of those records from the masterfile. Doing this makes sure that no duplicate work is performed.
Here's the code for Query A.
INSERT INTO [TABLE A1] ( OID, SystemLoc, SystemPN, Location, Part_Number, Qty, Date_n_Time, NL, RCHKL, RCHKP, oddeven, Auditor, upperlower, area, aisle, [section] )
SELECT TOP 100 MasterFileEdit.OID, MasterFileEdit.SystemLoc, MasterFileEdit.SystemPN, MasterFileEdit.Location, MasterFileEdit.Part_Number, MasterFileEdit.Qty, MasterFileEdit.Date_n_Time, MasterFileEdit.NL, MasterFileEdit.RCHKL, MasterFileEdit.RCHKP, MasterFileEdit.oddeven, MasterFileEdit.Auditor, MasterFileEdit.upperlower, MasterFileEdit.area, MasterFileEdit.aisle, MasterFileEdit.section
FROM MasterFileEdit
WHERE (((MasterFileEdit.oddeven) Like "*" & [Forms]![LocationAudit]![oddeven] & "*") AND ((MasterFileEdit.upperlower) Like "*" & [Forms]![LocationAudit]![upperlower]) AND ((MasterFileEdit.area) Like "*" & [Forms]![LocationAudit]![area]) AND ((MasterFileEdit.aisle) Like "*" & [Forms]![LocationAudit]![aisle]))
ORDER BY MasterFileEdit.section;
Everything after the 'FROM MasterFileEdit' after is the user selections that come from a form.
I need help writing the DELETE query. Here's what I've got thus far:
DELETE MasterFileEdit.OID, MasterFileEdit.SystemLoc, MasterFileEdit.SystemPN, MasterFileEdit.Location, MasterFileEdit.Part_Number, MasterFileEdit.Qty, MasterFileEdit.Date_n_Time, MasterFileEdit.NL, MasterFileEdit.RCHKL, MasterFileEdit.RCHKP, MasterFileEdit.oddeven, MasterFileEdit.Auditor, MasterFileEdit.upperlower, MasterFileEdit.area, MasterFileEdit.aisle, MasterFileEdit.section
FROM MasterFileEdit
WHERE (((MasterFileEdit.oddeven) Like "*" & [Forms]![LocationAudit]![oddeven] & "*") AND ((MasterFileEdit.upperlower) Like "*" & [Forms]![LocationAudit]![upperlower]) AND ((MasterFileEdit.area) Like "*" & [Forms]![LocationAudit]![area]) AND ((MasterFileEdit.aisle) Like "*" & [Forms]![LocationAudit]![aisle]));
I can't get the DELETE to sort. The query runs, but doesn't select the records it should. In fact, it doesn't select any of the correct records.
Thoughts: does the TOP 100 modifier work with Deletes?
Is this query even possible?
Thanks in Advance for your Help.
Matt
View 14 Replies
View Related
Feb 8, 2007
I don't know if this is the right place for my post. Since is in regard to queries...
I have data that I want to archive from one table to another table within a press of a button in a single form. The append work fine for me, but i tried adding the code to run the delete query to the same button as the append's one is, but giving me error that MS can't run the delete query because i have the form open exclusively. If I run the delete query with the form closed it work. How can I make the button to excute both append and delete queries at the same time.
Thanks in advance for the help
View 7 Replies
View Related
Feb 8, 2007
hey guys,
I'm new to this site, I have search a lot in this form regarding Delete and Append query used at the same time and couldn't find answer.
I have data that I want to archive from one table to another table within a press of a button in a single form. The append work fine for me, but i tried adding the code to run the delete query to the same button as the append's one is, but giving me error that MS can't run the delete query because i have the form open exclusively. If I run the delete query with the form closed it work. How can I make the button to excute both append and delete queries at the same time.
Thanks in advance for the help
View 1 Replies
View Related
Jul 19, 2006
I am basically making a form to streamline the processes and functionality of my database project, so basically it's just a form that runs queries.
However, whenever it runs an action query, it always brings up a yes or no prompt for whatever action it is doing. Is there any way to disable these prompts (i.e. default yes to everything) or is this just an annoyance I will have to deal with?
Thanks.
View 2 Replies
View Related
Jan 16, 2013
I've been creating a simple macro which will append data and then delete data from a table.The criteria for the queries is found in a form, and this is used as a paramter.However, when i run this all as a macro...the append and delete queries somehow can't read the criteria in the form. Rather...i have to type in the criteria again...and then it works.I have attached a copy of my DB.
1. Go to frmArchiveStock
2. Select a stock from the combo box (this the criteria for the append and delete queries)
3. Click the button to run macro mcrStockArchive.
How can i get the queries to pick up the value entered in the form to act as a criteria when they run?
View 1 Replies
View Related
Apr 11, 2007
why isn't my Access giving me warning before runing the delete, append or update query because usually it warns you that you are about to append, update or delete the following number of records. It must be the settings, can someone help!
View 9 Replies
View Related
Oct 25, 2013
I need to reset the autonumber each time I delete/append records in a table. Best way?
View 5 Replies
View Related
Aug 7, 2007
This is a very simple problem most likely for the masses, but I am new to access. I have employees who enter will enter information about specific tests on electronics components into separate tables by a form. I know my method is poor, but this is how it works. I got assigned this database at my internship this summer because they ran out of thigns for me to do.....I've never even used access before, so as long as it works, they're happy. I have a form which which writes to a first table with 20 fields. I then have separate update queries which take the data in the first table and put it in all the other tables. Trust me, i know this is pretty much the opposite of the whole point of a relational database, but I am and was limited by time, for the size of the database they want, there was no time to learn about normalization etc etc. Sorry this is wordy, but THE QUESTION is......if they run multiple tests wtih the same information for some of the fields I have fields named "Run#, Unit#, Date" etc, even if there is records wtih the same information, hwo do i get it all to show. Right now, it seems to be rewriting over the same records. If they run 3 tests on unit 10 on August 1st, how do i get it so all those show up. I think its somethign wtih in the table, for the primary keys, changing the Index: No, Yes(Duplicates) Yes(No Duplicates) but I could be way off. Thanks, if the question doesnt make sense i'll try to rephrase it, I apologize I'm running on about 45 min of sleep:confused:
View 3 Replies
View Related
Jul 12, 2013
I have an append query and want only the last row (Unique ID) to be added rather than the whole table. Is it do-able? Here is the SQL...
INSERT INTO TblCoursesRebooked ( StaffCourseID, Course, [Date], Staff, [Renewal Date] )
SELECT TblStaffCourse.StaffCourseID, TblStaffCourse.Course, TblStaffCourse.Date, TblStaffCourse.Staff, IIf(IsNull([Renewal in Years]),Null,DateAdd("yyyy",[Renewal in Years],[Date])) AS [Renewal Date]
FROM TblStaffCourse INNER JOIN (QryCourses INNER JOIN TblCourse ON QryCourses.CourseID = TblCourse.CourseID) ON TblStaffCourse.Course = QryCourses.[Course & Level]
GROUP BY TblStaffCourse.StaffCourseID, TblStaffCourse.Course, TblStaffCourse.Date, TblStaffCourse.Staff, IIf(IsNull([Renewal in Years]),Null,DateAdd("yyyy",[Renewal in Years],[Date]))
ORDER BY TblStaffCourse.StaffCourseID DESC;
View 4 Replies
View Related
Mar 24, 2015
I have two queries, both delete from the same table and both have joins..This one works:
Code:
DELETE RequestCheck.*
FROM(
SELECT TOP 3 PayRequest.RequestID, PayRequest.GBPAmount, PayRequest.Currency, PayRequest.RequestDate
FROM PayRequest
WHERE (((PayRequest.Currency)="EUR Euro") AND ((PayRequest.RequestDate)>#11/16/2014#))
ORDER BY PayRequest.GBPAmount
) AS TOP3 INNER JOIN RequestCheck ON TOP3.RequestID = RequestCheck.RequestID
WHERE (((RequestCheck.CheckID)=8));
This one does not:
Code:
DELETE RequestCheck.*
FROM 300_tblDeleteRequestCheck INNER JOIN RequestCheck ON [300_tblDeleteRequestCheck].RCID = RequestCheck.RCID;
View 1 Replies
View Related
Oct 25, 2005
Morning
I Have done a search but have not found an answer
I ran a delete query and specied fields to be deleted from certain records.
Instead of deleting the field it trys to delete the entire record.
Any ideas how i can get it to just delete fields and not the entire record.?
View 3 Replies
View Related
Aug 12, 2007
Is it possible to delete records in a table if it has no matching records in another related table by using a delete querie. I can find plenty of info on deleting matched records but nothing on unmatched.
View 1 Replies
View Related
Sep 19, 2005
Just wondering if someone can point me in the right direction so that i can solve my problem?
Basically what i have is a select query that carries out some calculations based on data entered. These calculations are expressions as i am sure you guys know. what i want to do is put the value from the expression/calculation into my table in the correct fields made for these values. However i have tried everything i can think of to get this data into the tables fields but to no avail.
example. Expr1: [field1]*[field2] the answer created by [Expr1] is the value i want to be placed in [field3]
Can anyone help me on how i can do this
View 4 Replies
View Related
Nov 11, 2004
I have a table that I want to append to another table, but I do not want to duplicate records if the check number is already in the table I am appending to. I have tried
<>[deposit].[check_number]
or
not like [deposit].[check_number]
or
not [deposit].[check_number]
but I always get prompted to enter a check number... therefore the criteria statement not working.
do not know what I am doing wrong.
View 5 Replies
View Related
Mar 7, 2007
Hi i am trying to delete all my queries in one go, is there an easy way to do this using a macro, module please?
View 2 Replies
View Related
Jun 8, 2005
Hi
Can anybody tell me how do I delete saved queries from vb code.
Thanks
Amar
View 1 Replies
View Related