From: DevlinM on
For an even simpler method, just set the form's Navigation Buttons to yes.
That will display the record number, the number of records and nav buttons
for navigating the records.

Cheers!

"adamskiii" wrote:

> I have created an unbound form in Access 2007 and am listing the records
> which are in my table. I found out how to show how many records there are in
> the table but would also like to show which record you are on. For example,
> when I click the next button to see the next record it will show: "Record 2
> Of 30", and so on. This is the one I used to count the amount of records:
>
> Dim countRecords As Long
> countRecords = DCount("customerNumber", "customer")
> Me.txtRecordAmount = "Record # Of " & countRecords
>
> How can I show what record I am on?
>
> Thanks
From: John W. Vinson on
On Sat, 27 Mar 2010 14:27:01 -0700, DevlinM
<DevlinM(a)discussions.microsoft.com> wrote:

>For an even simpler method, just set the form's Navigation Buttons to yes.
>That will display the record number, the number of records and nav buttons
>for navigating the records.

Only with a bound form. Adamskii is using an *unbound* form (so the nav
buttons will show 1 of 1).
--

John W. Vinson [MVP]
From: adamskiii on
Thanks. That is what I want, to show the current position of the cursor. I
tried this code but I keep getting an error. This is what I get:

"Run-Time error '2455'

You entered an expression that has an invalid reference to the property
CurrentRecord."


Here is the Code I used which keeps giving me errors:

Me.txtRecordAmount = "Record " & Me.CurrentRecord & " Of " & countRecords


Any help?
Thanks


"DevlinM" wrote:

> If you are just wanting to show the ordinal position of the cursor, you can
> use the form's CurrentRecord property in the Form_Current event.
>
> Private Sub Form_Current()
> Me.SomeTextBox = Me.CurrentRecord
From: Dennis on
My memory of this is fuzzy (as I hardly ever used it), but you MAY need to use:

"Me.Recordset.CurrentRecord" and "Me.Recordset.RecordCount"

To get what you want.



"adamskiii" wrote:

> Thanks. That is what I want, to show the current position of the cursor. I
> tried this code but I keep getting an error. This is what I get:
>
> "Run-Time error '2455'
>
> You entered an expression that has an invalid reference to the property
> CurrentRecord."
>
>
> Here is the Code I used which keeps giving me errors:
>
> Me.txtRecordAmount = "Record " & Me.CurrentRecord & " Of " & countRecords
>
>
> Any help?
> Thanks
>
>
> "DevlinM" wrote:
>
> > If you are just wanting to show the ordinal position of the cursor, you can
> > use the form's CurrentRecord property in the Form_Current event.
> >
> > Private Sub Form_Current()
> > Me.SomeTextBox = Me.CurrentRecord