Thank you once again.
>Hi Mary-Ann,
>
>You treat views like if they were tables. You insert the parent record first, the insert all the childs in the corresponding views. You start with the parent first, because you may have a relation integrity rule that prohibit inserting a child without a parent.
>
>To be sure that all records will be saved, you can include all the TableUpdate() inside a BEGIN TRANSACTION...END TRANSACTION loop.
>
>Example:
>
INSERT INTO Parent VALUES (...)
>INSERT INTO Child1 VALUES (...)
>...
>INSERT INTO Child2 VALUES (...)
>...
>BEGIN TRANSACTION
>
>IF TableUpdate(.T., .F., "Parent")
> IF TableUpdate(.T., .F., "Child1")
> IF TableUpdate(.T., .F., "Child2")
> END TRANSACTION
> ELSE
> ROLLBACK
> ENDIF
> ELSE
> ROLLBACK
> ENDIF
>ELSE
> ROLLBACK
>ENDIF
Of course, you may want to display a message if the transaction fail.
>
>HTH
>Really missing something. When you have a database with say, six tables that are all related, I figured the best way to work with the information is to create views of each. Having trouble when you want to add a record to the parent table (which then also needs to add a record to all the child tables). I am Inserting Into the view that comes from the primary/parent table. Do I also need to insert to all the child views? Bottom line, what is the best way to add a record to the Parent table and all the related child tables?
"Live Well, Laugh Often, Love Much..."