*---------------------- 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 ENDCASEI'm beating my head over this and other strange kind of problems, but could not figure a way to solve it.