lparameter lcItem local lnLen, lnWidth with This lnLen = alen(.aList, 1) + 1 lnWidth = alen(.aList, 2) if lnWidth = 0 dimension .aList[lnLen] .aList[lnLen] = lcItem else dimension .aList[lnLen, lnWidth] .aList[lnLen, 1] = lcItem endif .mFillColumns(lnLen) if .lUpdateRowSource This.mUpdateRowSource(lcItem) endif if alen(.aList, 1) > 1 =asort(.aList) endif .Requery() endwithREFRESH method
LPARAMETERS llCalledFromValid local lnResult, lcOldValue, lcAlias with This lnResult = 1 lcOldValue = "" lcAlias = .cSourceAlias if !empty(lcAlias) and used(lcAlias) if recno(lcAlias) <> .nRecord lcOldValue = eval(.ControlSource) .nRecord = recno(lcAlias) else lcOldValue = .DisplayValue endif else lcOldValue = .DisplayValue endif if !empty(lcOldValue) lnResult = ascan(.aList, lcOldValue) endif if lnResult = 0 .mAddItem(lcOldValue) endif *!* .DisplayValue = lcOldValue *!* .Value = lcOldValue if llCalledFromValid .Value = m.lcOldValue else if .parent.BaseClass=="Column" .parent.ControlSource=.parent.ControlSource else .ControlSource=.ControlSource endif endif endwithVALID method
local llRetVal llRetVal = This.Refresh(.t.) if not llRetVal return 0 endif>Where the MUPDATEROWSOURCE method is called from?
* Lostfocus >>>This.SetFocus() >>>NODEFAULT>>
>>lparameter tcItem >>if type("tcItem") = "U" .or. type("tcItem") = "L" .or. empty(tcitem) >> return .f. >>endif >>local lcAlias, lcField, lnSelect >>lcAlias = alltrim(This.cRowSourceAlias) >>lcField = alltrim(This.cRowSourceField) >>if empty(lcAlias) or empty(lcField) >> return .f. >>endif >>if not used(lcAlias) >> use (lcAlias) again in 0 >>endif >>if not This.mValidateField() >> return .f. >>endif >>lnSelect = select() >>_callingrec = RECNO() >>select (lcAlias) >> >>* this will check to see if there is an index tag to see if item exists, and use it >>* otherwise a LOCATE will be used. >>FOR nCount = 1 TO 254 >> IF !EMPTY(TAG(nCount)) && Checks for tags in the index >> * ? CDX(nCount) && Display .CDX names >> IF UPPER(TAG(nCount)) = UPPER(lcField) >> tagexists = .t. >> EXIT >> ENDIF >> ELSE >> tagexists = .f. >> EXIT && Exit the loop when no more tags are found >> ENDIF >>ENDFOR >>* IF UPPER(TAG(nCount)) = UPPER(lcField) >>IF tagexists >> SET ORDER TO (lcField) >> SEEK ALLTRIM(UPPER(tcItem)) >>ELSE >> locate for alltrim(upper(lcField)) == alltrim(upper(tcItem)) >>ENDIF >> >> >>if eof(lcAlias) >> >> if this.yesno("Add new record/value to "+alltrim(lcAlias)+"list?") >> >> APPEND BLANK >> replace (lcField) WITH (tcItem) >> * insert into (lcAlias) ( (lcField) ) values ( tcItem ) >>*!* IF CURSORGETPROP("Buffering")>1 >>*!* =tableupdate(.t.) >>*!* endif >> * browse >> if len(ALLTRIM(this.formadd)) > 4 >> * SELECT (lcalias) >> IF this.formparam = .f. >> do form (this.formadd) >> ELSE >> DO FORM (this.formadd) WITH ALLTRIM(UPPER(tcItem)) >> ENDIF >> endif >> this.Requery() >> else >> this.setfocus() >> endif >>endif >>select (lnSelect) >>GOTO _callingrec >>return eof(lcAlias) >>>>**************************************************************