Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Nothing works as I think it should!!!
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Nothing works as I think it should!!!
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01034001
Message ID:
01034001
Vues:
87
Hi everybody,

Ok, last two days I'm going in circles trying to solve problems with the second page of the very complicated form.

Here is my scenario:

I add a new record, then save it. I then run the Selector form, which instantiates the same biz object (with already saved data). I then select a record, which I just added, so I can modify it. It gives me an error, that record is not found in the view. However, then I close the form and check the data, the record is there.

Here is the button's click code (the Selector's button):
*---------------------- Location Section ------------------------
*   Library: 	Aformspatientdemo.vcx
*   Class: 	Mainview
*   Method: 	CmdGuarantors.Click()
*----------------------- Usage Section --------------------------
*)  Description:
*)

*   Scope:      Public
*   Parameters:
*$  Usage:
*$
*   Returns:
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	07/01/2005 - WGB
*		MODIFIED
*----------------------------------------------------------------
LOCAL lnObjCount, lnCount, loChildBizObj, loSelect, lnI

THIS.PARENT.SetGuarantorControls(.F.) && Disable Guarantor controls
THIS.cLocateValue = THISFORM.cTrans_pk

loSelect = CREATEOBJECT('cSelect')

THIS.cTrans_FK = THISFORM.cTrans_pk

=DODEFAULT()

DO CASE
CASE THIS.cAction = "CLOSE"
CASE THIS.cAction = "NEW"
	THISFORM.ReallyLockScreen(.T.)
	WITH THIS.PARENT
		.lDontInsertNew = .t. && We don't want to insert extra new record
		FOR lnI = 1 TO ALEN(.aBizObjs)
			.aBizObjs[lnI].Cancel()
			.aBizObjs[lnI].New()
		NEXT
		.lDontInsertNew = .f. && Reset back
		.setButtons()
		.REFRESH()
		.GuarantorBizObj1.lForce = .T. && Overcome the Update Conflict problem
		THISFORM.ReallyLockScreen(.F.)
		.SetGuarantorControls(.T.) && Enable Guarantor controls
		.cntGuarantor.txtLastName.SETFOCUS()
	ENDWITH
OTHERWISE
	IF !EMPTY(THIS.cSelectValue)
		SELECT v_guarantors
		LOCATE FOR cTrans_Relateds_pk = THIS.cSelectValue
		IF FOUND()
			WITH THIS.PARENT
				FOR lnI = 2 TO ALEN(.aBizObjs)
					.aBizObjs[lnI].REQUERY()
				NEXT
				.REFRESH()
				.SetGuarantorControls(.T.) && Enable Guarantor controls
				.cntGuarantor.txtLastName.SETFOCUS()
			ENDWITH
		ELSE
			ErrorMsg('Record with ' + THIS.cSelectValue	+ ' is not found in ' + ALIAS())
		ENDIF
	ENDIF
ENDCASE
I'm beating my head over this and other strange kind of problems, but could not figure a way to solve it.

The views are local, database is Foxpro, and all the data are on the local C drive.

Do you see a problem here?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform