Click to See Complete Forum and Search --> : Problem with Related Tables
Pedro de la Lastra
Aug 30th, 2000, 10:55 AM
I have 2 related tables and when I add(addNew) a record in the Parent table and then I try to add records to Child table (before make update in Parent) Iget an error because Parent key is autonumber and hasn't been created yet.
What should I do with that?
666539
Aug 30th, 2000, 11:53 AM
You could save the parent record before you save the child records, but you're probably not doing that because you don't want it saved if no child records are being added.
If you are using ADO maybe you could do this as a transaction. ADO has a begin transaction method. If the user adds a lot of line items then you'll want to use the commit transaction method. If they choose to cancel the transaction you could use the rollback method. I don't have much experience with transactions but this may be something you want to look into and because I don't have much experience with them I could be totaly wrong.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.