Board index » delphi » Master/Detail and Autoincremet

Master/Detail and Autoincremet

Maybe a simple problem, but I could nowhere find an answer(just a
beginner) :

I use Delphi 3 with Paradox -Tables.
In my Master-Table I have an autoincrement field as primary key,
and I try to use this field as masterfield for my detail-table, but when

I create new records, the value of the +/- field is not written in my
detail table.
I set the detail-field to integer,numeric... but it doesnt work.
When I use a numeric field as master-field everything is ok, but I need
this autoincrement.

Any suggestions ?

 

Re:Master/Detail and Autoincremet


In the OnNewRecord event on the detail, set the appropriate field to the
master key.

Robert

Quote
klixx wrote in message <36472019.1A958...@okay.net>...
>Maybe a simple problem, but I could nowhere find an answer(just a
>beginner) :

>I use Delphi 3 with Paradox -Tables.
>In my Master-Table I have an autoincrement field as primary key,
>and I try to use this field as masterfield for my detail-table, but when

>I create new records, the value of the +/- field is not written in my
>detail table.
>I set the detail-field to integer,numeric... but it doesnt work.
>When I use a numeric field as master-field everything is ok, but I need
>this autoincrement.

>Any suggestions ?

Re:Master/Detail and Autoincremet


Will this work?  I have always posted the master record first (because if it
is new, the autoinc field seems indeterminate), then it picks the value up
properly.

Dave Bissett

Quote
Robert Kaplan wrote in message <727fjk$g1...@news1.iamerica.net>...
>In the OnNewRecord event on the detail, set the appropriate field to the
>master key.

>Robert

>klixx wrote in message <36472019.1A958...@okay.net>...
>>Maybe a simple problem, but I could nowhere find an answer(just a
>>beginner) :

>>I use Delphi 3 with Paradox -Tables.
>>In my Master-Table I have an autoincrement field as primary key,
>>and I try to use this field as masterfield for my detail-table, but when

>>I create new records, the value of the +/- field is not written in my
>>detail table.
>>I set the detail-field to integer,numeric... but it doesnt work.
>>When I use a numeric field as master-field everything is ok, but I need
>>this autoincrement.

>>Any suggestions ?

Other Threads