'        Tip:其实很多问题在以前的贴子里都有过很好的解答,我建议大家提问前先搜一下以前的贴子,会节约很多时间的.
'
'     Author:吴文智
'       Date:2001-11-20
'Description:要试用本例请在窗体中填加一个按钮,一个Data,一个MsFlexGrid
'            然后在代码窗体中粘贴如下代码
'            Good luck!Option ExplicitPrivate Sub Command1_Click()
    MsgBox Data1.Recordset.AbsolutePosition, vbInformation, Me.MSFlexGrid1.Row - 1
End Sub
Private Sub Data1_Reposition()
    Me.MSFlexGrid1.Row = Data1.Recordset.AbsolutePosition + 1
End SubPrivate Sub MSFlexGrid1_RowColChange()
    Data1.Recordset.AbsolutePosition = Me.MSFlexGrid1.Row - 1
End Sub

解决方案 »

  1.   

    楼上的,我都说了AbsolutePosition在我这是不可以用,提示“该对象不支持此类操作"另外我的data是用代码写的,不是绑定的,如下
    Public cgrst As RecordsetPrivate Sub Form_Load()
    Set cgrst = cgdb.OpenRecordset("用户资料", dbOpenTable, dynaset) 'dbSeeChanges)
    Set Data1.Recordset = cgrst
    Data1.Refresh
    End Sub
    不知道为什么说不支持AbsolutePosition
      

  2.   

    好象一般不用这个操作,
    可以用findfirst试试设一个索引字段(不重复,非空,唯一)
    如 id as integer
    .findfirst id=i