Deleting Multiple Tables Or Queries

Mar 6, 2007

Hi.

I have a cluttered database with too many 'no longer necessary' queries and tables.

Is there a way (other than deleting them one at a time) to delete multiple ones at once, as I can in My Documents, et cetera?

Russ

View Replies


ADVERTISEMENT

Queries :: How To Count Records Based On Multiple Criteria From Multiple Tables

Jan 4, 2014

I need to count records based on multiple criteria from two different tables. I have two tables (i.e. "tblTasks" and "tblTaskHistory"). The tables have a one-to-many relationship based on the "TaskID" field. "tblTasks" has a field called "AssignedTo" and "tblTaskHistory" has a field called "TaskStatus". I need to know how many tasks have been "reopened", the "reopened" status is located in the "TaskStatus" field in "tblTaskHistory". I need this count against a unique listing of employees which can be found in the "AssignedTo" field in "tblTasks".

View 4 Replies View Related

Queries :: Possible To Set Multiple Conditions Across Multiple Tables

Apr 10, 2013

Is it possible to set multiple conditions across multiple tables using OR in a where clause? For instance, can you run where......

(table1 = 'test') or (table2 = pass) or (table2 = "fail) AND (class = 'SQL');

View 1 Replies View Related

Tables :: Deleting Matching Records From Two Tables

Dec 5, 2012

I have two tables "Master List" and "Audit". I want to delete the records from the "Master" that match those in the "Audit". I am using Access 2010 and have used it often but have built very few queries.

View 3 Replies View Related

Deleting Multiple Records In Listbox...?

Jul 6, 2006

hey all,
I'm using this code on a command button to delete single entries in a listbox... and it works fine
Private Sub DeleteMovie_Click()
CurrentDb.Execute "Delete from " & _
"tblMovies " & _
"where Title = """ & Me.lstList & """", dbFailOnError

Me.Requery
Me.lstList.Requery
Me.lstList = ""
End Sub
However, I want to try to select and delete multiple items in the list box. So I changed the property to allow multiple selections and now the button doesn't do anything when I click it. Ideally, I'd like the button to provide a "are you sure (yes or no)" prompt. Anyone know how to get this working? thanks a bunch

View 6 Replies View Related

Deleting Multiple Rows From A Table?

Oct 5, 2013

the assignment is to delete rows in a table that consist of employee ids 202 - 205

I input the following code:

delete from sec0412_foods
where employee_id between '202'
and '205';

And then I come across this error:

Where am I making a mistake?

View 3 Replies View Related

Modules & VBA :: MDB File - Deleting Multiple Items In List At Once

May 28, 2014

In appendix is .mdb file with this thema.

Inside you can find one form with listbox (with multi selecting ability).

I use this code :

Dim strSQL As String
Dim i As Variant
With Me.se1
For Each i In .ItemsSelected
SQL = "DELETE '*' FROM [t1] WHERE [id] = " & .ItemData(i) & " ;"
CurrentDb.Execute (SQL)
Next
End With
Me.se1.Requery

Result is this one :
1) If I delete only one item in list, it is ok. I can do it again and again and it is working fine.

BUT

2) If I delete more items in list at once, it is ok - but if I will try to do it again then there is an error because .ItemData(i) value is Null.

View 10 Replies View Related

Deleting Multiple Records From Access In Datasheet View?

May 15, 2013

When I highlight multiple records and choose delete, it only deletes 1 record.

Is it possible to delete more than one record at a time?

View 2 Replies View Related

Deleting Tables

May 11, 2006

:confused:
I am Developing a simple VBA program for Access for my final year of my Degree and I have come up with a problem that I don’t seem to be able to fix.

I have create tables using SQL

SQL = "CREATE TABLE tblInvoiceLines" & _
"(InvoiceNo LONG, PartNo LONG," & _
"Quantity LONG)"

DoCmd.RunSQL (SQL)


Deleting this with the below code works,

SQL = ""
'This will delete the Invoice Line Table
SQL = "DROP TABLE tblInvoiceLines"
DoCmd.RunSQL (SQL)


But once I alter the table with the below code the Delete command doesn’t work, does anyone know how I can fix this problem?

SQL = "ALTER TABLE tblInvoiceLines " & _
"ADD CONSTRAINT fkInvoiceNo " & _
"FOREIGN KEY NO INDEX (InvoiceNo) REFERENCES " & _
"tblInvoices (InvoiceNo) " & _
"ON UPDATE CASCADE " & _
"ON DELETE CASCADE "


conDatabase.Execute SQL


Thanks
Coops

View 2 Replies View Related

Deleting Tables

Jun 7, 2006

Hi i have a lot of linked table that i want to delete I have the macro below that deletes one at a time but i have to put in the name is there a way to delete all the ones that end in _cfd_posting as before this name there is a six digit number but these r all different is this possible

Sub delete()
DoCmd.DeleteObject acTable, "060204_cfd_postings"
End Sub

View 1 Replies View Related

Deleting Tables

Nov 17, 2004

In my program you are allowed to make backups of the current databases to an external file. It also allowes you to get the tables back from one of those files. At least it should.

I thought this wouldn't be a biggy. I thought I'd just delete my current tables and replace them with "docmd.tranferdatabase" acImport.

But the stupid thing wont let me delete its tables because they are connected to each other. Can I somehow delete the link before deleting them?

If so will the links be there again once I restore the tables from the backup?
Or do I need to reconnect them somehow to each other.

Or maybe another approach would be to import them without deleting the original ones. Thus the new ones get the same name of the original ones + "1" or something. Than I delete all records from all my original tables. And refill them with all the records from the new ones (the + "1"-ones) And delete the new ones. And if I would do that, would it be best to use AcImport or AcLink (from docmd.tranferdatabse)

Can I have some pro's oppinion on this plz.

View 1 Replies View Related

Deleting All Tables At One Go

Nov 30, 2006

I was wondering if there is a way in selecting all tables and deleting at one go instead of selecting one by one. Perhaps a little bit of programming. Tx in adv

Shah:)

View 14 Replies View Related

Queries :: Archiving Data From Multiple Tables

Jun 24, 2013

I have a database with employees. The tables are as follows:

Deptdatatble
Depttble
Emptble
HRtble
Servicetble
Servicedatatble
Archivetble
Classestble
Classdatatble

At certain times, I want to archive employees out (lets say they are terminated). When I do this, something strange happens. If an employee has 4 records in the servicedata table and 4 records in the Classdata table, then it exports out 16 records (4 x 4). I would expect it to export out 8 records.

View 6 Replies View Related

Queries :: Update Command Multiple Tables Using IIF

Aug 10, 2013

I am writing a sql to assign students to each section of a course. The first student would be in the first section and the second student in the second section.

The ClassParam table gives the number of sections for the course and the last period that was assigned.

The Classes table gives the class key number by class name and section number.

The student has the name of class they want to take and I want to move the class section number into the Choice1 field.

The IIF statement seems to work but all of the students are getting the 1st session of the class put into the choice1 field.

UPDATE Students, ClassParam, Classes SET Students.Choice1 = Classes.ClassID,
ClassParam.PeriodAssigned = IIf([ClassParam]![PeriodAssigned]>=[ClassParam]![NumOfSections],1,
[ClassParam]![PeriodAssigned]+1)
WHERE ((([Students]![FirstChoice])=[Classes].[ClassName] And ([Students]![FirstChoice]) Is Not Null And ([Students]![FirstChoice])<>"") AND (([ClassParam]![PeriodAssigned])=[Classes].[SectionNumber]) AND (([Classes]![ClassName])=[ClassParam].[ClassName]) AND ((ClassParam.ClassName)=[Students]![FirstChoice]));

View 2 Replies View Related

Queries :: Search Across Multiple Tables With One Query

Apr 18, 2013

Is it at all possible to search across multiple tables with one query. I have a database with about 15 tables and my users would like to be able to search for text across all the fields in all the tables. I have a simple find record command on each table, but in case they are not sure which table to search i would like to offer a search function which in theory searches the whole database.

I have 15 tables (eg witnesses/policies/activities etc), each with different fields (eg name, address/ policy decision, policy reason/ activity undertaken, activity person etc etc) . In total i would like to be able to search about 50 fields. All i need returned from the search is the record ID from the relevant table, or anything to simply identify the record & relevant table. And then they could go to the correct place to look the record up.

I have been looking for an answer for a while. I have seen queries where you enter the parameters against each field going down a row each time for criteria being "OR" each time, but there are a limited number of rows on a query design so i run out of rows.

View 7 Replies View Related

Queries :: Update Multiple Tables From One Form

Feb 10, 2014

I have 2 main tables. One with Data that I get from an outside source and cannot be changed. The other is one that needs to be updated as needed. I have a few look up tables so I can identify the codes with the descriptions. In 2003 I was able to make a big query and link my forms to the query to make modifications. I am not able to edit any information in the 2010 query. The people want it to work the way it did in the past but I am not skilled enough in access to do that. Is there an easy way to use a query when updating the form? I used to be able to edit the query itself and it would feed back into the existing tables.

View 1 Replies View Related

Queries :: Search Multiple Tables In Access?

Jul 19, 2013

I have a database built in Access 2000. It consists of the following tables:

45 tables each containing the same fields - ID, Vehicle, Fit, Part No, Qty, Level, Higher Assembly.

1 table containing the fields - ID, Part Number, Description, Issue No.

The 45 tables are each for a different vehicle build of materials, whilst the single table contains the additional common data that each vehicle form pulls in when the build of materials part number is added.

I want to be able to undertake a search across the 45 vehicle tables to look for a specific part number that I enter in the search box, and then if any is found, for all those vehicle to be displayed, along with the part number, description and issue number from the single table.

View 1 Replies View Related

Queries :: Find Difference Between Multiple Fields In Two Tables

May 8, 2013

I have a database with two tables, one for the amount that was estimated in each cost section, and one for the actual amount billed for each cost section. The tables have the same number of fields, all with the same names. They can be linked together with event ID. Each table has over 100 fields and I would like to find the difference between what was estimated and what the actual was for each event. I would also like to see which cost section has the most and least variance. I am trying to do this without going through each cost and putting [tEst].[CostName]-[tActual].[CostName].

View 2 Replies View Related

Queries :: Reading From Multiple Tables Through ODBC Connection

Jul 14, 2015

I am working on an MSACCESS database that reads data from SQL Server through ODBC Connection.

I have multiple tables that I have linked in and created Queries that read the data and created Make Table query.

However, I am asking if there's a way to bring the data through a query that doesn't need the linked tables. Is there a way to bring different fields from different tables into one query without needing to import all the tables, since the tables have many fields that I don't need.

For example in MS Excel, I am able to do that, a query that will bring external data from SQL Server from different tables and only brings the fields that I need for my report.

View 2 Replies View Related

Queries :: Getting A Text Field Count From Multiple Tables

May 16, 2013

I am working with 4 tables and I am trying to get a count of the email address field in each table grouped by Email Group Name. I tried the dcount function but returned an error because some of the email addresses have an apostrophe in the field. Is there a way to do this in 1 query? This is an example of the result I would like:

EmailGroup/TtlEmailSents/TtlEmailsOpened/TtlEmailsClicked/TtlFormSubmits
AAA 50 30 15 10
BBB 100 75 50 20
CCC 60 25 5 1

Tables:
Emails Sent
Emails Opened
Emails Clicked
Form Submits

Field Names in all tables:
Email Group Name
Email Address

Field I want to count is Email Address for each table, grouped by Email Group Name.

View 5 Replies View Related

Queries :: Query To Combine Different Fields From Multiple Tables?

May 13, 2014

I get tasked to use access very infrequently but now I have been asked to create a database. I am struggling with combining 2 tables. I have different data on each table however I do have a unique Identifier. So on table 1 I have Bud, his height, weight, etc. On table 2 I have Bud his home address, phone #, etc. I am using name "Bud" in this case as my unique identifier. I want to create a query that gives me Bud, his height, phone # etc. I want my query to pull in all records. Bud may only have info on table 1 and Budette could be on table 2 but not on table 1. I would like my query to include all the unique identifiers and as much info as I have in the tables.

View 7 Replies View Related

Deleting And Saving In Tables From Form

Oct 17, 2005

I am trying to make a database for a shop which can do several things:

1) I want to give in what is being bought by the shop to make their products form. This has to be saved in a table named STOCK.

2) I want to be able if I say in a form that from these things I made that product that these things dissapear from the STOCK table and that the final product is added to the STOCK.

3) If the final product is solled I want to remove it from stock.

In the end if I want to see what is still in the stock I will only have the things that are still there because the rest is removed.

How can I do this??

Thanks for your answer

View 1 Replies View Related

Deleting Tables Of Import Errors

Mar 17, 2005

Greetings all.

Having searched the last couple of days, I am unable to find a resolution to this problem. If it has been answered already, a simply link or thread name would be appreciated. If not, help is greatly appreciated.

I have code running that imports data from a .txt file into a table.however, on some days there will be errors importing some of the data. I have found that from the last three months, there has been no data of consequence lost so, I don't care about the data errors. However, any time there is an error with the import it creates a table that is named for example:

01-03-05 Auth_ImportErrors

where "01-03-05 Auth" is the name of the file imported. So each time they import a file, a new table is created. Is there any code that I can run that can automatically delete these tables upon exit?

I'm just tidying up really.

Thanks in Advance.

View 3 Replies View Related

Deleting Rows From Joined Tables

Jun 5, 2006

I am using the following query to identify rows in one table that have no match in another:

SELECT MAS.MASID
FROM MAS LEFT JOIN IVT ON MAS.Field1=IVT.Field1
WHERE ((IVT.IVTID) Is Null);


MAS is one file with MASID as the key.
IVT is the other file with IVTID as the key

This provides me a list of the rows in MAS with no match in IVT.

I now want to delete these rows in MAS so we can process the other fields in the table.

what is the syntax for the delete statement? I can't get the join to fit in correctly.

Help!

View 2 Replies View Related

Deleting Import Error Tables

Dec 31, 2004

I routinely import from an Excel document provided by a third party. Most data in it is ok, but 10-15 records always end up in the import error tables which Access creates automatically when formats do not match.
I am trying to automate this whole process thru VBA and am pretty successful so far, except that I haven't figured out how to programatically get rid of these tables (I do not need them, and data imports anyway).
Is there a way to destroy a table programatically in Access?

Thanks

View 1 Replies View Related

Tables :: Keeping Records Rather Than Deleting?

Oct 31, 2014

If a user wishes to delete a record, rather than deleting the record i'd like to change its status to not current for instance.

The reason being that the information in the records may be useful for statistical use.

I added a yes/no field to the table and then added some code to a delete button to change the yes/no.

I can't seem to hide these records from my forms (using filter) but I could be going the wrong way about it.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved