Record X of Y

N

Nad

Hi Guys,
How do i display record X of Y on my from(in TextBox).My form is based on
Updatable query & i removed the record selector.
Help Please...
Thanks & Regards,
 
A

Allen Browne

Try:
=[Form].[CurrentRecord] & " of " & [Form].[RecordsetClone].[RecordCount]

There are some problems with that:
a) When you first load the form, the RecordCount may be 1. So it may not
give the correct count until it finishes loading records.

b) Access 2007 will fail with that expression. You will need to use a
function to get the count in this version.

c) Really old versions (Access 2 and earlier) can't handle this either.

More info:
Numbering Entries in a Report or Form
at:
http://allenbrowne.com/casu-10.html
 
N

Nad

Thanks Allen for your quick reply.
I did like this and its working fine.

Private Sub Form_Current()
Dim RecCount As Integer
RecCount = Me.RecordsetClone.RecordCount
Me.TxtRecCount = Me.CurrentRecord & " of " & RecCount
End Sub

Regards
Allen Browne said:
Try:
=[Form].[CurrentRecord] & " of " & [Form].[RecordsetClone].[RecordCount]

There are some problems with that:
a) When you first load the form, the RecordCount may be 1. So it may not
give the correct count until it finishes loading records.

b) Access 2007 will fail with that expression. You will need to use a
function to get the count in this version.

c) Really old versions (Access 2 and earlier) can't handle this either.

More info:
Numbering Entries in a Report or Form
at:
http://allenbrowne.com/casu-10.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Nad said:
Hi Guys,
How do i display record X of Y on my from(in TextBox).My form is based on
Updatable query & i removed the record selector.
Help Please...
Thanks & Regards,
 

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