|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, im new to Access. I have started to build a simple 1-to-1 relationship address book with 3 tables. one contact has data in all 3 tables which is identified by the contacts unique "file number". Now what i would like to know is how would i create a delete button which will delete a contacts data from each of these 3 tables with one simple click?
Thankyou for your help ShadoWolf ![]() |
|
#2
|
||||
|
||||
|
Access allows you to specify the relationship between each table. The other tables which contain address data should be somehow linked to the main table, via a foreign key. You can setup this relationship using the Relationships too - here, you can specifying cascade delete.
|
|
#3
|
|||
|
|||
|
re:cascade delete
Quote:
If its a 1 -1 relationship can you specify cascade delete? thx robi |
|
#4
|
|||
|
|||
|
I have worked it out, it is a one-to-one relationship. All you need do is go to the relationship screen, double clik the relation ship line and it will give you the options for that relationship. Simply check the "enforce Referential Integrity" check box which will activate the two check boxes below it "cascade update related fields" and "cascade delete related records" just check the last check box and bobs your uncle, it works!
|
|
#5
|
|||
|
|||
|
re:worked it out
Quote:
I tried that. The form looks great but the data in the children tables isn't being deleted. Did you check your tables to verify the rows are being deleted? |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Deleting records from 3 tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|