Hi....
I'm trying to do a cascade of 1 to many records, where Person ->Goal -> EffStandard ->LrnObjective, and I want to be able to open up a new goal, and then pop open that goals standards, so so on down to the last in the chain. I've got these set up in the data environment of the person record, with the correct relations. All the child forms are frmdatachildmodal, so I'm assuming that the this is the cmdatamanager is the one for the "person" form, (which is the topmost parent table)
I set this up using code similar to the Pizza example, which I've used without problems when there was only a single parent/child.
As I add the additional frmdatachildmodal forms, and grids, I have the feeling that there needs to be some additional code under the New/Edit/Delete buttons to refresh things correctly. For example:
I can add up to two child records; they'll then appear correctly in the grid. However, a third child record will not appear correctly in the grid. If I then close everything, and reopen it, it appears that the child record has been added, however; it appears in the grid as it supposed to.
I've tried the following:
1. Saving the parent record first.
1. Issuing a tableupdate(), then a requery() then a grid refresh
2. Issuing a specific SELECT
under each New().
I don't know if you could give me some hints, about how to make this work reliably?
Sample code is below my sig.
Best wishes,
-- Larry
======================
Lawrence Keyes
Microdesign Consulting Inc.
phone:802.658.4673
lkeyes@mxdesign.net
www.mxdesign.net
www.techfornonprofits.com
=================================================================
PRIVATE oCallingForm
m.oCallingForm=THISFORM
LOCAL oDialog
IF lkSubForm.IsNew('Effstd')
lkSubForm.SAVE('Effstd')
ENDIF
SELECT lrnObjective
THISFORM.cmDataManager.New('lrnObjective')
m.oDialog = CREATEOBJECT('frmclrno', THISFORM)
m.oDialog.SHOW()
m.lStatus=m.oDialog.ReturnValue()
IF m.lStatus=.F.
THISFORM.cmDataManager.DELETE('lrnObjective')
ENDIF
m.lkMasterForm.cmDataManager.updateall()
-- Larry Keyes
Remember only You can prevent Gray Goo. Never release nanobot assembers without replication limiting code.