Private Sub Command4_Click() ' True DBGrid will follow the record movement. Data1.Recordset.MoveFirst DBGrid1.SetFocus End SubPrivate Sub Command5_Click() ' True DBGrid will follow the record movement. Data1.Recordset.MoveNext
' Keep the current record away from EOF, which is not a ' valid position. If Data1.Recordset.EOF = True Then Data1.Recordset.MovePrevious End If
DBGrid1.SetFocus End SubPrivate Sub Command6_Click() ' True DBGrid will follow the record movement. Data1.Recordset.MovePrevious
' Keep the current record away from BOF, which is not a ' valid position. If Data1.Recordset.BOF = True Then Data1.Recordset.MoveNext End If
DBGrid1.SetFocus End SubPrivate Sub Command7_Click() ' True DBGrid will follow the record movement. Data1.Recordset.MoveLast DBGrid1.SetFocus End Sub
if rs.eof then msgbox "已到尾部!" 或者 if rs.eof then rs.movefirst
' True DBGrid will follow the record movement.
Data1.Recordset.MoveFirst
DBGrid1.SetFocus
End SubPrivate Sub Command5_Click()
' True DBGrid will follow the record movement. Data1.Recordset.MoveNext
' Keep the current record away from EOF, which is not a
' valid position.
If Data1.Recordset.EOF = True Then
Data1.Recordset.MovePrevious
End If
DBGrid1.SetFocus
End SubPrivate Sub Command6_Click()
' True DBGrid will follow the record movement. Data1.Recordset.MovePrevious
' Keep the current record away from BOF, which is not a
' valid position.
If Data1.Recordset.BOF = True Then
Data1.Recordset.MoveNext
End If
DBGrid1.SetFocus
End SubPrivate Sub Command7_Click()
' True DBGrid will follow the record movement. Data1.Recordset.MoveLast
DBGrid1.SetFocus
End Sub
if rs.eof then rs.movefirst