Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retreive Relations in Form
Message
From
15/11/1998 23:41:10
 
 
To
15/11/1998 21:18:53
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00157722
Message ID:
00157764
Views:
22
I am a little unclear still on what exactly you are trying to do...
Is this like a developers only type form? Are you trying to figure out at run time which of two tables should be shown in a grid?

Ok. If you are always only dealing with 2 tables nad one relationship, this should be easy. You want to drop 2 tables into the DE of the form, drag some fields from the parent table onto the form and run (right?). How do you want to navigate the parent records? Do you have a vcr buttons class? Or are there possibly two grids? Either way, using the method I outlined below, you should be able to decide which is the parent alias and which is the child, so which cursor is the grid's recordsource...

If you give me a little more detail on the functionality you want, I'd be happy to help you brainstorm...



>Hi Eric,
>
>Thanks for the reply and the help for that part of the puzzle. I am trying to come up with a generic form to add edit view 1 to many type of related tables. I hope to drop the parent table and the child table in a form then drop in some controls to view add edit the tables. This is mostly for maintenance of the tables. I think that at this point I need some general pointers on building this generic form. I am having trouble getting it all to blend into one clear outline of what I need to do. Any help is welcomed.
>
>
>>>I need to make a form that will handle a parent child relation that I can view, edit, or add to the child or parent table. How can I read the relations of the tables that are used in the form so I can give the user the option to add to the parent or child table?
>>>
>>>Thanks
>>
>>If you are talking about relations that are set at design time in the DE, then these appear as objects in the DE. You can get to them with something like:
>>
>>
>>lnDEMemberCount =AMEMBERS(aDEMembers, THISFORM.DataEnvironment, 2)
>>FOR i = 1 TO lnDEMemberCount
>>	oDEObj = EVAL('THISFORM.DataEnvironment.' + aDEMembers[i])
>>	IF LOWER(oDEObj.BaseClass) = "relation"
>>		?oDEObj.ChildAlias
>>		?oDEObj.ParentAlias
>>		?oDEObj.ChildOrder
>>	ENDIF
>>ENDFOR
>>
>>
>>HTH
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform