forms- record count

J

john

ive removed the record navigationbuttons/record selectors from a form and replaced with command button

what i want to know is how do i get a text box/label to display something like 'record 5 of 34' with out having to use the ones ive taken of

thank

joh
 
C

Cheryl Fischer

John,

Create a Label control on your form named, lblNavigate

Insert the following VBA code in the On Current event of the Form:

Dim lngrecordnum As Long

lngrecordnum = Me.CurrentRecord
If Me.NewRecord Then
Me!lblNavigate.Caption = "New Record"
Else
With Me.RecordsetClone
.Bookmark = Me.Bookmark
End With
Me!lblNavigate.Caption = "Record " & Me.CurrentRecord & " of " &
Me.RecordsetClone.RecordCount
End If


--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


john said:
ive removed the record navigationbuttons/record selectors from a form and replaced with command buttons

what i want to know is how do i get a text box/label to display something
like 'record 5 of 34' with out having to use the ones ive taken off
 

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