home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 6 Unleashed…sional Reference Edition) / Visual_Basic_6_Unleashed_Professional_Reference_Edition_Sams_1999.iso / Source / CHAP08 / 309X0809.TXT < prev   
Encoding:
Text File  |  1998-06-17  |  863 b   |  40 lines

  1.  
  2. Public Sub MoveFirst()
  3.  
  4. ' If rsMain has been assigned, move to the first
  5. ' record in the recordset and update the scroll
  6. ' bar's position.
  7. If Not (rsMain Is Nothing) Then
  8.     rsMain.MoveFirst
  9.     hsbRecScroll.Value = 1
  10. End If
  11.  
  12. End Sub
  13.  
  14.  
  15. Public Sub MoveLast()
  16.  
  17. ' If rsMain has been assigned, move to the last
  18. ' record in the recordset and update the scroll
  19. ' bar's position.
  20. If Not (rsMain Is Nothing) Then
  21.     rsMain.MoveLast
  22.     hsbRecScroll.Value = hsbRecScroll.Max
  23. End If
  24.  
  25. End Sub
  26.  
  27.  
  28. Public Sub MoveToRecord(RecNumber As Long)
  29.  
  30. ' If rsMain has been assigned, move to the given
  31. ' record number in the recordset, but only if it
  32. ' is within the valid range.
  33. If Not (rsMain Is Nothing) Then
  34.     If RecNumber >= 1 And RecNumber <= rsMain.RecordCount Then
  35.         rsMain.AbsolutePosition = RecNumber
  36.     End If
  37. End If
  38.  
  39. End Sub
  40.