diff --git a/comp/src/gb.db.form/.src/DataTable.class b/comp/src/gb.db.form/.src/DataTable.class index dfd8fdd33..4aaa55893 100644 --- a/comp/src/gb.db.form/.src/DataTable.class +++ b/comp/src/gb.db.form/.src/DataTable.class @@ -171,7 +171,7 @@ Public Sub Find(sWhere As String, Optional iFrom As Integer) As Integer Dim rFind As Result sSelect = "ROW_NUMBER() OVER (" & $DB.SQL.OrderBy(GetSortKeys())() & ") AS __index" - sReq = $DB.SQL.Select([sSelect, "*"]).From($sTable).Where($sFilter)() + sReq = $DB.SQL.Select(["*", sSelect]).From($sTable).Where($sFilter)() sReq = "SELECT * FROM (" & sReq & ") AS __pg_sucks WHERE " & sWhere If iFrom > 0 Then sReq &= " AND __index >= " & CStr(iFrom + 1) @@ -180,7 +180,7 @@ Public Sub Find(sWhere As String, Optional iFrom As Integer) As Integer If rFind.Count = 0 Then Return -1 Else - Return rFind[0] - 1 + Return rFind["__index"] - 1 Endif End diff --git a/comp/src/gb.db.form/.src/DataView.class b/comp/src/gb.db.form/.src/DataView.class index 50690bb84..e989eb536 100644 --- a/comp/src/gb.db.form/.src/DataView.class +++ b/comp/src/gb.db.form/.src/DataView.class @@ -89,6 +89,7 @@ Public Sub _new() $bAllColumns = True Update Create() + UpdateMode $bHighlight = True UpdateHighlightColor @@ -941,7 +942,7 @@ Private Sub UpdateMode() Object.Lock($hCtrl) - If $bCreate And If HasNewRecord() Then + If $bCreate And If Not HasNewRecord() Then $hCtrl.Mode = Select.None Else $hCtrl.Mode = $iMode