mloucel
Member
- Local time
- Today, 03:40
- Joined
- Aug 5, 2020
- Messages
- 356
Hello all..
I am trying to relearn programming (NEW JOB) and my boss wants a simple form, I have almost got a few things thru youtube and this forum, but I can't seem to solve this that maybe so easy for many or ALL of you.
Problem:
I have a form with buttons First/Last/Next/Back that go thru records she wants, all is working except...
when I try to check for the last record buttons (commands) NEXT and LAST must be disabled
it does .. sort of....
here is the problem:
When it hit the last record it doesn't do anything, except that if I hit NEXT goes to a BLANK record and then it does find the last and disable the buttons.
so let's say I have 5 records, when I hit 5 it does nothing
but if I hit NEXT it goes to 6 and then it says I found the last record and of course disable the buttons, I need those buttons disabled on 5 not 6
Here is my SIMPLE CODE:
' Last record
If Me.CurrentRecord >= Me.Recordset.RecordCount Then
Me.cmdNext.Enabled = False
Me.cmdLast.Enabled = False
Else
Me.cmdNext.Enabled = True
Me.cmdLast.Enabled = True
End If
Any Ideas what am I doing wrong, everything else is just perfect..
Any help would be greatly appreciated...
I am trying to relearn programming (NEW JOB) and my boss wants a simple form, I have almost got a few things thru youtube and this forum, but I can't seem to solve this that maybe so easy for many or ALL of you.
Problem:
I have a form with buttons First/Last/Next/Back that go thru records she wants, all is working except...
when I try to check for the last record buttons (commands) NEXT and LAST must be disabled
it does .. sort of....
here is the problem:
When it hit the last record it doesn't do anything, except that if I hit NEXT goes to a BLANK record and then it does find the last and disable the buttons.
so let's say I have 5 records, when I hit 5 it does nothing
but if I hit NEXT it goes to 6 and then it says I found the last record and of course disable the buttons, I need those buttons disabled on 5 not 6
Here is my SIMPLE CODE:
' Last record
If Me.CurrentRecord >= Me.Recordset.RecordCount Then
Me.cmdNext.Enabled = False
Me.cmdLast.Enabled = False
Else
Me.cmdNext.Enabled = True
Me.cmdLast.Enabled = True
End If
Any Ideas what am I doing wrong, everything else is just perfect..
Any help would be greatly appreciated...