JefSummers <jefsumm...@aol.com> wrote in article
<19971231153801.KAA04...@ladder02.news.aol.com>...
Quote
> You're almost there. In the OnShow routine for the child form, set the
> datasource for the controls to MainForm.Datasource1 or whatever.
Remember this
> has to be a datasource, not the table itself. Alternatively, you could
put a
> TTable and TDatasource on the child form, then link them to the record on
the
> main table by specifying, again, in OnShow, the MasterSource and linked
fields
> for the second table. BTW, in D3 you can do this all at design time.
Thanks to all the people who replied, either by email or news,
suggesting substantially the same thing: that D3 allows the link
between control and dataset to be made in Object Inspector but that in
D1 this link must be made at run-time, eg from an OnShow procedure.
Steve Koterski (Borland database support) suggested placing a DataSource
on the child form and linking all the dbEdit fields to it (using Object
Inspector), then setting
DataSource1.DataSet := Form1.Table1; {link child's dataset to parent's
table}
in the child form's OnShow procedure.
This gets me a lot further, but I've still got a problem. The dbEdit
fields are blank and won't accept any input. Having defined the DataSet
for DataSource1, I presume for each dbEdit control I need to define the
corresponding field name DataField. In the OnShow function I've tried
putting statements of the form:
DBEditAddrSurname.DataField := frmSelectAddress.AddrTab.AddrTabSURNAME;
where: DBEditAddrSurname is a dbEdit control
frmSelectAddress is the parent form (what Steve
called Form1")
AddrTab is the table object (what Steve
called "Table1")
AddrTabSURNAME is the corresponding field, as
displayed by Object Inspector; in
Fields Editor (and the Paradox table
itself) it's called SURNAME
But this won't compile - it gives "field identifier expected", pointing
at "AddrTab.|AddrTabSURNAME" (cursor denoted by "|").
What am I doing wrong. I confess that I'm more fluent in C than Pascal!