Record Count

A

Andi B

Greetings all!

In an Access database I am creating, I am using a form to display
information. This form has its record navigator turned off as I am using my
own buttons for a more professional look. What I would like to know is, is
it possible to duplicate the "Record X of Y" that appears on the standard
record navigator? I have used code from
http://www.mvps.org/access/forms/frm0026.htm and while this works, it only
displays "Record 1 of 1" until I navigate to another record, whereupon it
will correct itself to read "Record 2 of 349" - is there a way to avoid it
displaying incorrectly in the first instance? (The number of records in the
database can change as users add or delete entries, so using a constant
wouldn't work...)

Many thanks in advance of any assistance,

Regards


Andi
 
D

Douglas J. Steele

It's doubtlessly due to the fact that not all of the records have been read
when it displays the first record, so it doesn't know what the total count
it going to be.

See whether what Stephen Lebans has at
http://www.lebans.com/recnavbuttons.htm solves this problem (knowing
Stephen, I'm sure he's figured it out!)
 
M

martin W

When you open a table it is neccessary to do a recordset.movelast and then
immediately a recordset.movefirst. Without that you can never rely on
recordcount
 
A

Alex White MCDBA MCSE

If you are using ADO and you set the cursor type to adOpenKeyset after
opening, the .recordcount property will give you the correct recordcount
without having to scroll front-to-back through the recordset.
 
A

adsl

Andi B said:
Greetings all!

In an Access database I am creating, I am using a form to display
information. This form has its record navigator turned off as I am using
my own buttons for a more professional look. What I would like to know is,
is it possible to duplicate the "Record X of Y" that appears on the
standard record navigator? I have used code from
http://www.mvps.org/access/forms/frm0026.htm and while this works, it only
displays "Record 1 of 1" until I navigate to another record, whereupon it
will correct itself to read "Record 2 of 349" - is there a way to avoid it
displaying incorrectly in the first instance? (The number of records in
the database can change as users add or delete entries, so using a
constant wouldn't work...)

Many thanks in advance of any assistance,

Regards


Andi
 
A

adsl

martin W said:
When you open a table it is neccessary to do a recordset.movelast and then
immediately a recordset.movefirst. Without that you can never rely on
recordcount
 
A

adsl

Alex White MCDBA MCSE said:
If you are using ADO and you set the cursor type to adOpenKeyset after
opening, the .recordcount property will give you the correct recordcount
without having to scroll front-to-back through the recordset.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
A

adsl

Alex White MCDBA MCSE said:
If you are using ADO and you set the cursor type to adOpenKeyset after
opening, the .recordcount property will give you the correct recordcount
without having to scroll front-to-back through the recordset.

--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
A

adsl

martin W said:
When you open a table it is neccessary to do a recordset.movelast and then
immediately a recordset.movefirst. Without that you can never rely on
recordcount
 
A

adsl

Andi B said:
Greetings all!

In an Access database I am creating, I am using a form to display
information. This form has its record navigator turned off as I am using
my own buttons for a more professional look. What I would like to know is,
is it possible to duplicate the "Record X of Y" that appears on the
standard record navigator? I have used code from
http://www.mvps.org/access/forms/frm0026.htm and while this works, it only
displays "Record 1 of 1" until I navigate to another record, whereupon it
will correct itself to read "Record 2 of 349" - is there a way to avoid it
displaying incorrectly in the first instance? (The number of records in
the database can change as users add or delete entries, so using a
constant wouldn't work...)

Many thanks in advance of any assistance,

Regards


Andi
 
Top