Scroll bar

  • Thread starter Thread starter E. Toivonen
  • Start date Start date
E

E. Toivonen

I have a table in Datasheet view. When I move the vertical
scroll bar, I can see a little yellow box reading
(eg.): "record 1 of 9", in which the first number changes
when I move the bar. Can it (the number) be used as input
to a subprogram?

Regards Eero Toivonen
 
When you open a DAO recordset in code, the RecordCount property tells you
how many records are in the recordset, and the AbsolutePosition property
tells you the relative record position of the current record (starting at
0). In code behind a form, you can grab the RecordSetClone, move to the
current form record, and find out these same values:

Dim rst As DAO.Recordset
' Get a copy of the form's recordset
Set rst = Me.RecordSetClone
' Sync to the current record
rst.BookMark = Me.BookMark
' Display the record position data
MsgBox "Current record is " & rst.AbsolutePosition + 1 & _
". Total records: " & rst.RecordCount

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
Back
Top