Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nothing works as I think it should!!!
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01034001
Message ID:
01034021
Views:
24
Can you requery the view?

>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.
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform