home *** CD-ROM | disk | FTP | other *** search
-
- Private Sub hsbRecScroll_Change()
-
- ' If rsMain has not been assigned, do nothing.
- If Not (rsMain Is Nothing) Then
- ' Move to the record number indicated by the
- ' scroll bar.
- rsMain.AbsolutePosition = hsbRecScroll.Value
- ' Check for a BOF condition...
- If rsMain.BOF Then
- ' The recordset is at BOF. The action to take
- ' is specified by the BOFAction property.
- Select Case msdcBOFAction
- Case sdcBOFActionConstants.sdcMoveFirst
- rsMain.MoveFirst
- Case Else
- Exit Sub
- End Select
- Exit Sub
- End If
- ' Check for an EOF condition...
- If rsMain.EOF Then
- ' The recordset is at EOF. The action to take
- ' is specified by the EOFAction property.
- Select Case msdcEOFAction
- Case sdcEOFActionConstants.sdcMoveLast
- rsMain.MoveLast
- Case sdcEOFActionConstants.sdcAddNewRecord
- ' Add a new record, and update the
- ' scroll bar's Max and Value
- ' properties.
- rsMain.AddNew
- hsbRecScroll.Max = rsMain.RecordCount + 1
- hsbRecScroll.Value = rsMain.RecordCount + 1
- Case Else
- Exit Sub
- End Select
- Exit Sub
- End If
- End If
-
- End Sub
-