Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting records from more than one table

Status
Not open for further replies.

Tofias1

MIS
Jun 17, 2002
57
US
Hello everyone out there. I would like to say thanks in advance for taking a look at my question. Ok, so here it is.
I have designed my database using referential integrity. What I would like to do is delete the primary key from the main table and all the secondary keys from all relating tables. I have the cmd button pass word protected and what I would like to do is have the button call two subs. ex if password = password then go to sub 1..... Well, I guess here is my question if the password = true should I have the sub call a module where the primary keys value gets stored and then do a search for all tabels? In a nut shell thats it. If anyone could help it would be greatly appreciated.

Tofias1
 
Probably a better approach if you have done a good job of setting up referential integrity is to turn on cascading deletes. The cascading delete function helps you avoid "orphan" records in your database by deleting "automajically" records in related child tables.
Hope this helps.
 
jmeadows7,

WOW, i wish they would have taught me that in school. I think I make things to coplicated. I probably should spend more time on looking up simpler things. So thanks a lot it worked.

Tofias1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top