Bespoke Record Counter

caferacer

Registered User.
Local time
Today, 20:56
Joined
Oct 11, 2012
Messages
96
Dear All,

For some reason on initial opening of the main form (frmProducts), the bespoke record counter shows 1 of 1, despite there being more records? If you move to a another record the counter corrects itself and is then okay?

Bizarrely, if I make the Access navigation buttons visible the problem goes away?

I have used two different bits of code and both suffer from the same problem.

Any ideas?

Thanks
 

Attachments

Try:
Code:
    If Me.NewRecord Then
        Me.lblRecordCounter.Caption = "New Record"
    Else
        Me.lblRecordCounter.Caption = _
         "Record " & Me.CurrentRecord & " of " & Me.Recordset[B][COLOR="Red"]Clone[/COLOR][/B].RecordCount
    End If
 
No luck with the above. Still the same?
 
..
Bizarrely, if I make the Access navigation buttons visible the problem goes away?
Then open the form with the navigation buttons visible and then in the On Current event make the the navigation buttons invisible.
 
Downloaded the DB, but no change, still shows 1 of 1 on first opening?
 
Then open the form with the navigation buttons visible and then in the On Current event make the the navigation buttons invisible.
I think JBH actually meant to say "Open the form with the buttons invisible and then in the forms OnCurrent event make the buttons visible."
That certainly seems to work:)
 
I think JBH actually meant to say "Open the form with the buttons invisible and then in the forms OnCurrent event make the buttons visible."
NO - I meant what I wrote, (that works)! :D

Code:
    If Me.NewRecord Then
        Me.lblRecordCounter.Caption = "New Record"
    Else
        Me.lblRecordCounter.Caption = _
         "Record " & Me.CurrentRecord & " of " & Me.Recordset.RecordCount
    End If
  Me.NavigationButtons = False
 
Thank you for the correction, but I assumed that the OP would want to be able to see and use the buttons.:confused:
I'm not sure about that, because he wrote:
Bizarrely, if I make the Access navigation buttons visible the problem goes away?
 
I'm not sure about that, because he wrote:
Yes that's right, but I thought we were talking about the navigation buttons that the OP has created on the form. As long as the OP is happy and the db works as he/she requires then I don't suppose it matters greatly. :)
 
Thank you both,

I just tried to get Me.NavigationButtons.Visible = False to work utill I read your new posts

Me.NavigationButtons = False has done the job.

Didn't actually know you could hide the nav buttons that way (should of thought, still learning).

Regards
 

Users who are viewing this thread

Back
Top Bottom