William,
Brings back memories way back.
Suggest you use views for data entry, use the default values within your primary key fields to generate the autonumber that act as the foreign key for the child table
Something like :-
use headertablename share in 0
use view_header nodata share in 0
use view_detail nodata share in 0
=cursorsetprop("buffering",5,"view_header")
=cursorsetprop("buffering",5,"view_detail")
code for append records in header /detail
Upon saving
begin transaction
if tableupdate(view_header) (let the default value generate the key)
m.primary_key = headertablename.primary_key_field
select child
scan
replace child foreign key with m.primary_key_value
endscan
if tableupdate(view_detail)
end transaction
else
rollback
endif
I'm using my own codes for the default values generation at present.
HTH
Yau
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only