Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating a paramaterized view
Message
 
To
02/06/1998 15:15:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00104154
Message ID:
00104168
Views:
23
>Sorry for the really basic questions, but I'm trying to make sure I understand this whole thing before diving into the deep end.
>
>Thanks,
>
>Sylvia
Sylvia,

Your questions are not to be appologized for by any means. The concept of views is this, I can have pseudo tables of data that look very different from the actual tables that the data is stored in for a variety of different purposes. This idea alone indicates that you will have more than one view in a system.

If you have a combobox that is used to select a child record based on a parent record, you make a view of the child table with the parent primary key as the parameter. When your user tells you the parent records you set the parameter variable and then requery() the child view. If the view is being used to populate a combo or list you must also call the requery method of that combo or list so it will look again at its rowsource to see that the contents have changed.

If I had to deal with a parent to child to grandchild relation in a fomr I would use two parameterized views, one for the the child with the parent PK as the parameter and one for the grandchild with the childs PK as the parameter. This way I can let the user select the parent and then show them the children, as they chose a child I can then show them the grand children for that child.

The controlling of the requerying of the views is handled in the events of the various controls. For example; say you have a form with a list of parent records. I would bring the form up with nonparent selecte4d and with the child and grandchild views open with the NODATAONLOAD set to .t.. In the Valid event of the parent list I would set the parameter variable for the child view and then Requery("ChildView") and THISFORM.ChildList.Requery() which will populate the child list with the children for the selected parent. I would do essentially the same thing in the child list for the grandchild.

Now you may have to make some assumptions to keep everything going well, like assuming that upon selecting the parent the first child should be automaticaly selected and the gradnchild list populated accordingly.

I know this is a lengthy reply but I hope it gets you thinking in terms of simplifying each piece of what you need to do and getting that simple piece working flawlessly and then introducing another simple piece. After a bit of this you end up with a simple but sophisticated interface.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform