>>>>Vfp 9 SP1
>>>Then you could use Integer AUTOINC instead of N(10).
>>>That way you will be sure that you always will have a unique ID. There are some difficulties to get that Id back but all could be done.
>>
>>If you want to add children before you save the parent, you would not be able to do it with AutoInc field.
>
>And from where these children comes from?
>Even orphans have some parents :-)
>
>You could add children firs, but then after you add parents you must update Parent(s) FK fields.
>You could have a records like this:
>
>
>Id Parent1 Parent2
>-------------------------
>1 7 15
>7 0 0
>15 0 0
>
Parent
Id Other fields
Child
ID ParentID Other fields
In the form I add a parent and a child. How can I know what ParentID to put in the Child table without saving parent first?
This problem has no solution with autoincrement fields.
If it's not broken, fix it until it is.
My Blog