Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 11th, 2004, 11:49 AM
ShadoWolf ShadoWolf is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 4 ShadoWolf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Deleting records from 3 tables

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

Reply With Quote
  #2  
Old February 11th, 2004, 05:52 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
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.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old February 12th, 2004, 09:38 AM
robi0193 robi0193 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 robi0193 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
re:cascade delete

Quote:
Originally Posted by stumpy
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.


If its a 1 -1 relationship can you specify cascade delete?
thx
robi

Reply With Quote
  #4  
Old February 12th, 2004, 11:08 AM
ShadoWolf ShadoWolf is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 4 ShadoWolf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking Worked it out

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!

Reply With Quote
  #5  
Old February 12th, 2004, 12:14 PM
robi0193 robi0193 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 robi0193 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
re:worked it out

Quote:
Originally Posted by ShadoWolf
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!

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?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > Deleting records from 3 tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT