In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Advise requested on Data Entry for Parent/Child Browse objects

Xailer professional forum in English
g.s.rogers
Mensajes: 202
Registrado: Dom Feb 17, 2008 3:35 am

Advise requested on Data Entry for Parent/Child Browse objects

Mensaje por g.s.rogers »

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
Responder