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.
: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.
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
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)
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
I have a list of objects (forms,queries,macros,reports the number varies but could be up to 100) that need to be deleted from several other databases (about 20).
I could do this by hand (go into each database and select and delete each object) but this is slow and error prone.
I could create a macro and import it into each database and then execute it (I know how to do this)
or (!!!!!!)
there should be some way to be in one database (HOME) and programatically (VBA) delete in the other database (OTHER).
I know how to
Dim db As Database Set db = DBEngine.Workspaces(0).OpenDatabase("c:other.mdb")
What do I do next. I could use the db.execute command for tables (which I don't want to delete) but what about forms,queries,macros, and reports ???? I tried to modify the MsysObjects table but ran into permission problems.
I have a database that links to an excel sheet and take data from it. For a fail safe i put deletes in several places in case of user error to make sure the sheet is deleted. If it is already deleted the other deletes don't act well.
I need to write a conditional iff statement that if it doesn't exist it ignores the delete call. Not sure how to structure it.
Private Sub Command3_Click() DoCmd.DeleteObject acTable, "Sheet1" DoCmd.Close acForm, "District Select Form" End Sub
We have a MS Access Application. It involves authentication as well. I split the database and created this db_be file. I deleted this. Now I'm not able to login into this Application.
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.
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 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?
i have a data base with a primary key but some records have been added from a excel data base and now the data base has duplicate records with different primary keys. I do a Query looking for duplicate records based on a field not the the primary key. There are 315 out of 22000. I can sort the table and then manually delete the dups. The Query does not allow deleting records so finding the culprits in the full Data base is time consuming. How can i delete the duplicate records using a query? Is this function available hidden someplace in the guts of Access? Seems like this would be a frequent problem. The Microsoft forum addresses this problem and the only viable solution is the manual method, when they get to the Query method it looks like they just forgot what the subject was and tell you how to delete one record if you know what the criteria is. If two non Key fields are Identical then i want to delete one of the records.
I'm running MS Access 2007. I'm creating an import procedure (for 2003 and 2007) that will automatically import an EXCEL file into a table for MS Access 2003 and 2007. The automatic import procedure works fine, but everytime the procedure is ran it creates an 'ImportError' table, due to blank rows (i.e. 'Type Conversion Failure'). The blank rows are due to the source EXCEL file not having value in a cells. This is normal for the source EXCEL file. These 'ImportError' tables are numbered each time this procedure is ran. I added a 'DoCmd' (see below for statement) statement in the procedure delete these tables, The below statements are used in a loop. I see that there are several procedures out there that use 'DAO' to accomplish this. If possible, I would like to use something that will use the below 'DoCmd' statements. This will eliminate the need to touch each PC to set 'ADO' or 'DAO' on.
My challenge is to take about 200 boxes, all of which are stuffed with file folders, and to create a database of their contents. That's all well and good. I made a simple table that listed the record, the date, etc, but I ran into trouble fairly quickly when I came across a folder that had folders inside of it. Basically I need a way to represent the folder structure the way it is in the box that makes sense within Access. What I'm imagining is something like this:
Record 1 Record 2 Record Group: - Record 1 - Record 2 Record 3 Record 4
More recently though, I'm wondering if don't need to make a whole new table for that set of data. I just don't know how to set up the relationship
So I am pulling data from a SQL data base into access and appending it to certain tables. To do this I have 15ish append queries. Is there a way to have them run in a certain order with one command?
I am preparing a "simple" training database. I want to do this smartly and not duplicate data.
My first table is the list of employees and their information. I have set a primary key (PK) up for each employee.
My second table is a list of training courses - title, description, start/stop time, credits, ... Each of these courses has a unique number (PK).
It's the final database table that is driving me nuts. I want it to show whether a n employee has taken/will take/not planning to take a course. My idea is to have a status field and then wanted to link that with a student number and a course number from the other tables.
In the past I would just have put common data fields StudentName from one table and CourseName from the other into the final database tables as a means of linking them. But I thought/read it's better to use a PK instead. Well when I make the third table up I get all of this Type Mismatch errors.
I realize that some data entries are no longer needed. I want to delete them. However, I have this data within a relationship dependent upon autonumbers. For instance, table 1 is linked to table 2 is linked to table 3. As of now, only data in table 1 exists. In the future, corresponding data in 2 and 3 will need to be entered. How can I make sure that by deleting some entries within table 1, that i will not jeopardize the functioning of tables 2 and 3? What does one do in a situation like this?
My table (excel spreadsheet) sits on another directory from the DB. If I delete the table on this directory and immediately replace it with a table with the same filename, format, etc (only the data has changed) will each database user have to relink the table on their desktop DB? Or will the forms/subforms/reports still maintain their relationships/functions and just display the new data?
I have a number of linked tables that vary depending on use. How to delete them or drop them all from the database? I produced/stole some code that deleted all tables - but it didn't delete the linked ones.
I'm exporting data from a database (using a query) to create an excel spreadsheet. I then import said spreadsheet into a new database. I was hitting lots of problems (subscript out of range, violating this that and the other etc etc) which I cleared up and actually imported the data. Well today I cleared down the new database and imported the spreadsheet again and got this.
the contents of fields in 0 records were deleted and 0 records were lost due to key violations.Thereby followed what to do when you get these things happening.Now to me 0 records deleted and 0 records lost means it's all worked. WRONG!! No records were imported at all.