Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find - List Dialog
Message
From
10/11/2002 03:21:52
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00718579
Message ID:
00720721
Views:
11
Hi Mel:

>However, I need to do something a little different. I need to design a special Find or List dialog that will allow me to Find any child record - no matter what parent that child belongs to.

Probably the simplest way to do this is to use the native VFP seek command. Seek on the child table to find your record. If you find it, record its primary key in a variable, note its parent's key value to a variable too.

Then, seek on the parent table. When you have found the parent record, using the parent cursor's CDE object, call its RecordWasMoved method. This will re-sync the datamanager with your changes (pointer relocation) to the parent cursor that it did not know about. Then go back to the child table. Depending on your RI logic, the re-sync on the parent table may have moved the child record again. That's OK. As you recorded the child table's PK value, you can do one of a few things. You could call the form's Find method passing it the child cursor's name and a search expression. Or, you could just do another native VFP seek on the child and *then* call the RecordWasMoved method on the child cursor's CDE object. This will tell the datamanager that you have moved the child cursor. The net effect of calling the child cursor object's RecordWasMoved is that it will then let the framework re-sync all related data below itself automatically, by respecting the relationships described between the child cursor and the grandchild cursor(s) and the great-granchild cursor(s) and so on. Calling the form's Find method should re-sync the child cursors related cursors which is why I mention it. Either way, you have a couple of things you can look at.

HTH
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform