forms- record count

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top