Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cascade data entry forms for 1-many
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Titre:
Cascade data entry forms for 1-many
Divers
Thread ID:
01079033
Message ID:
01079033
Vues:
62
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

=================================================================
* Click for New() button for adding new Learning Objectives 
PRIVATE oCallingForm
m.oCallingForm=THISFORM

LOCAL oDialog

* -------------
* Save the parent record, if it hasn't already been saved.
* LK 10/25/2005
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. && User didn't want to add this record after all
	THISFORM.cmDataManager.DELETE('lrnObjective')

ENDIF

*LK 12/14/2005
m.lkMasterForm.cmDataManager.updateall()
* THISFORM.grdObjective.REFRESH() 
-- Larry Keyes
Remember only You can prevent Gray Goo. Never release nanobot assembers without replication limiting code.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform