How to cascade delete and update related records in Access?

Acces is one of the best programs that exist to manage your database as it should. Because this not only brings the normal functions of other programs, but also implements its own (such as being able to create reports or the possibility of creating forms and queries ). With that in mind today you will learn how to cascade delete and update related records in Access?

If you do not know this function or process, then it is your lucky day, because here you will get all the information you need. Since this really helps to simplify various jobs, which you probably haven’t been doing as well as you should (it’s always good to learn something new).

What is cascading delete for?

The first thing you have to know before starting the process that will help you determine the answer to How to cascade delete and update related records in Access ? , is what this option is for.

Basically what both the elimination and the cascade update do (they are almost the same), is to eliminate or replace an element of a related row, causing a chain reaction that will apply the changes in the other table.

This is very useful, because it allows you to automatically delete the records , without having to select one by one in each table. It should be noted that the best thing about this process is that it does not touch the source or base code, since it is an internal function designed precisely to automate the work.

 

This option is good to use, because when trying to delete a row the integrity error will not jump (which occurs because there are several data related to each other). Some examples of what kind of jobs it can be used for would be:

In continent registry (that you have as a relation countries), in employee lists, among others. The reality is that you can apply it wherever you want. However, keep in mind that the disadvantage of using this process is that you will not recover the data in the case of deletion (you will not have the other backup table), so be careful when making changes.

How to cascade delete and update related records in Access?

As you already have more information about the operation of the Cascade option, it is time for you to see how to do it, so that you finally know the answer to the question How to cascade delete and update related records in Access ?. But before that, they have to bear in mind that in order to follow the steps well, you must know how to create, modify or execute a query in the program (so you don’t get lost among so many buttons).

The first thing you have to do is go to the “Database Tools” tab From there to the group called ” Relationships “, in this choose the option that bears the same name.

Then in the “Relations” group of the “Design” tab, click on “All relationships”, with this action you will see a list of all the tables that have a relationship (these will have their respective relationship line).

Then click on the relation line of the table to which you want to make a change (having it selected will make it thicker). Then double-click on that line, or select the option ” Tools ” from the group called ” Design “, and there choose “Modify relationships”.

 

Thanks to that, you will skip the modification dialog. Within it there will be two boxes, one will be called “Cascade update related fields” and the other “Cascade delete related records”. Enable the one you want to use (it can be both). Then click on ” OK “, with that everything should be ready, so your table should already be modified as you wanted.

As a small conclusion …

With that last thing you saw, you have already solved the question How to cascade delete and update related records in Access? , so you have nothing else to do here. Remember that in this program, you can do countless things. So it wouldn’t be bad if you learned more about him. For example, obtaining knowledge of how to join or combine databases , among other things.

 

Leave a Comment