Advise requested on Data Entry for Parent/Child Browse objects
Publicado: Mar Nov 11, 2008 4:35 am
I wanted to get some advice from News Group members who have already
accomplished what I am trying to learn -- the easiest way to have a Parent
and a Child browse object on a form and allow data entry in to one, or the
other, or both.
I've looked at the DataControls example 6 and it seems a little complex for
me to understand at this point. It looks like it uses a TArrayBrowse object
for the child, reading data into the array from a oDbfDataset on form
initialization, using a button click method to add a row to the array and
the TArrayBrowse:Edit() method to get user input, then using a ::SetValue()
method in the TArrayBrowse::PostEdit() method to update the TArrayBrowse row
values. I suppose the array gets written back to the proper dataset at some
point.
I thought originally I could use two TDBBrowse componets and got so far as
to get a form that correctly displays existing parent/child data in the two
objects. However, looking at the documentation for the TDBBrowse component,
it seems that the component is linked to one (and one only) dataset field,
requiring a calculated field composed of other field values in order to add
or edit multiple field values. Again, this seems a bit complex for me at
this point in terms of writing the methods to add new data (or edit data)
using TDBBrowse objects.
So, I guess I am wondering if the easiest way would be to use two related
datasets with two TDbfBrowse components. I don't want the user to enter data
directly into the child browse object, but rather pop a form for the data
that would complete one row of the child object.
Any advice as to the easiest way to proceed?
TIA,
Gary S. Rogers
accomplished what I am trying to learn -- the easiest way to have a Parent
and a Child browse object on a form and allow data entry in to one, or the
other, or both.
I've looked at the DataControls example 6 and it seems a little complex for
me to understand at this point. It looks like it uses a TArrayBrowse object
for the child, reading data into the array from a oDbfDataset on form
initialization, using a button click method to add a row to the array and
the TArrayBrowse:Edit() method to get user input, then using a ::SetValue()
method in the TArrayBrowse::PostEdit() method to update the TArrayBrowse row
values. I suppose the array gets written back to the proper dataset at some
point.
I thought originally I could use two TDBBrowse componets and got so far as
to get a form that correctly displays existing parent/child data in the two
objects. However, looking at the documentation for the TDBBrowse component,
it seems that the component is linked to one (and one only) dataset field,
requiring a calculated field composed of other field values in order to add
or edit multiple field values. Again, this seems a bit complex for me at
this point in terms of writing the methods to add new data (or edit data)
using TDBBrowse objects.
So, I guess I am wondering if the easiest way would be to use two related
datasets with two TDbfBrowse components. I don't want the user to enter data
directly into the child browse object, but rather pop a form for the data
that would complete one row of the child object.
Any advice as to the easiest way to proceed?
TIA,
Gary S. Rogers