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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

records won't delete 1

Status
Not open for further replies.

storer

Programmer
Mar 27, 2000
41
0
0
US
Have a subform that is based on a query with 2 tables that have a one to many relationship. The key from the one side is the link between the main form and subform. I can add records to the subform fine, but when I delete (do have cascading update and delete turned on)only the record from the many side of the query for the subform deletes. The record on the one side does not and I want it to! I've played around with a test database with two similar tables and can't get it to work there either. I must be doing something very basic wrong but can't figure it out. Any help? thanks!
 
I'm assuming you're using a datasheet, and deleting with a record selector? It's because you're sending a "mixed" message. The place to delete the one side isn't there, since the many side is what distinguishes the records. In other words, if I have company and contact like so:

c1 Mr. X
c1 Ms. Y
c1 Ms. Z
c2 Mr. L
c2 Mr. M

and so on, how when you select Mr. X to delete can the datasheet know you're really trying to delete c1? Deleting the one-side of the relationship must take place at the one-level, and not at the many-level. Doing it with code would work, but you won't get a datasheet to do it all alone.

On the other hand, as you mentioned, when you add a record, it allows you to put in the one-side and the many-side at the same time. The two processes are not mirrors.
 
BTW, Welcome to TT Down... Terry M. Hoey

Please read the following FAQ to learn how to help me help you...

faq183-874
 
thanks for your help! I realize my problem was in the one to many relationship. After looking closer at the tables, the information they contained and how they related to each other, they should really have a one to one relationship...which also fixed my problem!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top