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.

Example of oDataSet:SetRelation Needed

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

Example of oDataSet:SetRelation Needed

Mensaje por g.s.rogers »

I'm trying to create a form with two oDbfBrowse objects with the dataset in
one browse object being the parent and the dataset of the other browse
object showing child records.
In the form initialize event, I set the relationship like this:
METHOD FormInitialize( oSender ) CLASS Form_ConsolidatedPrecincts
with object ::oDbfDataSetAssignedPrecincts
:Open()
:AddIdxFile("CAVCPIEP") // IDNO+ECODE+PRCODE
:AddIdxFile("CAVCPREP") // ECODE+PRCODE
SET ORDER TO 1
end with
with object ::oDbfDataSetConNames
:Open()
:AddIdxFile("CAVCONID") // IDNO
:AddIdxFile("CAVCONEC") // ECODE+CONNAME
SET ORDER TO 2
:SetRelation("IdNo",::oDbfDataSetAssignedPrecincts)
:GoTop()
end with
::oDbfBrowseConNames:SetDBF("CAVCONSL")
::oDbfBrowseConNames:GoTop()
::oDbfBrowseAssignedPrecincts:SetDBF("CAVCONPR")
::oDbfBrowseAssignedPrecincts:GoTop()
::oDbfBrowseConNames:SetFocus()
RETURN Nil
The child browse object shows every record in the
oDbfDataSetAssignedPrecincts, rather than just child records of the active
row in the parent browse object.
What am I doing wrong?
Responder