I have a xBrowse
I need switching Recordset dynamically ,and the table and fields of the recordset are not identical.
I solved in this way
Open new Recset oNewRs
FOR i := len(oBrwLis:aCols) to 1 STEP - 1
oBrw:DelCol(i)
NEXT
oBrw:SetADO( oNewRs )
oRsOld:Close()
oBrw:GoTop()
oBrw:Refresh()
Is correct use oBrw:SetADO( oNewRs ) or can cause side effects ?
I have another question
In the xBrowse I have logical columns : COL_1 , COL_2,...
I do not understand why this works
FOR nX := 1 TO len(oBrw:aCols)
  WITH OBJECT oBrw:aCols[nX]
    :SetCheck()
    :bStrData := { || ""  }
    IF :cExpr == "COL_1"
      :bEditValue := { || IF(  oBrw:oRs:Fields("COL_1" ) :Value  == -1 ,.T.,.F.) }
    ENDIF Â
    IF :cExpr == "COL_2"
     :bEditValue := { || IF(  oBrw:oRs:Fields("COL_2" ) :Value  == -1 ,.T.,.F.) }
    ENDIF Â
  END
NEXTand this dosn't work
FOR nX := 1 TO len(oBrw:aCols)
  WITH OBJECT oBrw:aCols[nX]
    :SetCheck()
    :bStrData := { || ""  }
   Â
    :bEditValue := { || IF(  oBrw:oRs:Fields(:cExpr) :Value  == -1 ,.T.,.F.) }
   Â
   Â
  END
NEXTThanks in anticipation
Maurizio
http://www.nipeservice.com
www.nipeservice.com