Record n of n

O

Osokop

I have a form where I would like to replicate what the built in access 2003
navigation buttons do but am having trouble creating the "Record n of n
Records" control. For several reasons I do not want to use the built in
navigation buttons since I cannot control where they go on the form. I want
to create a new control or controls which gives me a value something like
"Record 1 of 77 Records" using code. I have been able to count the total
records so I have the of 77 Records part, but cannot figure out how to place
the current record number in a control for the first part of this problem.

Thank you in advance!
 
G

Gina Whipp

Osokop,

You can place this on the On_Current of the form. You will need a text box
named txtPage.

If Me.RecordsetClone.RecordCount = 0 Then
DoCmd.CancelEvent
Else
With Me.RecordsetClone
.MoveLast
Me.txtPage = Me.CurrentRecord & " of " & .RecordCount
End With
End If

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top