ChildAlias, ChildOrder, OneToMany, ParentAlias, RelationalExpr
These are properties of a relation in the data environment of a form, label or report. They indicate, respectively, the alias and order of the child table in the relation, whether the relation is one-to-many, the alias of the parent table in the relation, and the expression from the parent that controls the relation.When you drag a field from one table onto a tag of another, a relation is created with the first table's field for RelationalExpr and the second table's tag as ChildOrder. ChildAlias and ParentAlias are filled in automatically and can't be changed.ChildOrder and RelationalExpr also apply to grids that are the "many" side of a one-to-many setup. If the tables involved have the appropriate relation, you don't need to set these properties at the grid level. When the tables don't have the relation, set it up for the grid.
Usage |
cChildAlias = frmForm.DataEnvironment.relRelation.ChildAlias cParentAlias = frmForm.DataEnvironment.relRelation.ParentAlias |
Usage |
frmForm.DataEnvironment.relRelation.ChildOrder = cTagname cTagName = frmForm.DataEnvironment.relRelation.ChildOrder |
Usage |
frmForm.DataEnvironment.relRelation.OneToMany = lIsOneToMany lIsOneToMany = frmForm.DataEnvironment.relRelation.OneToMany |
Usage |
frmForm.DataEnvironment.relRelation.RelationalExpr = cExpr cExpr = frmForm.DataEnvironment.relRelation.RelationalExpr |
Example |
* These properties are normally set in the property sheet * Assume you've put TasTrade's Customer and Orders tables * in the Data Environment of a form. To have a one-to-many * relation between them, properties are set as follows: ThisForm.DataEnvironment.Relation1.ChildOrder="customer_i" ThisForm.DataEnvironment.Relation1.RelationalExpr="Customer_id" ThisForm.DataEnvironment.Relation1.OneToMany=.T. |
See Also |