Board index » delphi » Record not copying from same physical table different logical table

Record not copying from same physical table different logical table

I have a skeleton record I want to copy to all new records when
created so I have the field assignments in OnNew.

The skeleton in in a filtered TTable (say taSkeleton) that
filters for only that record. In OnNew for the main table (say
taMain) I have the following:

taSkeleton.Active:=True;
// taSkeleton.First; (shouldn't be necessary since filter is //
only for one but doesn't help in  any case)

taMainField.Value:=taSkeletonField.Value;

The problem is that the skeleton record is not found. I have
checked the filter by lining it (via a datasource) to a grid and
it show the single record fine. I can understand locking issues if
I try to access the same physical record but I am using separate
datasets.

 

Re:Record not copying from same physical table different logical table


Quote
>taMainField.Value:=taSkeletonField.Value;

>The problem is that the skeleton record is not found.

What is the exact error message?

are you sure you are using correct field names?

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Record not copying from same physical table different logical table


My problem was that I had not removed mastersource and hence was
not finding the 'proforma' record.

Pat Bell

Other Threads