Hello,
I have an Excel form that displays records from an external file. The form has these buttons to traverse the records:
[<<] , [ < ] , [ > ] , [>>] (viz. btnFirst, btnPrevious, btnNext, btnLast)
The buttons are not assigned to macros; instead they are part of the VBA code (below). How do I properly check for a button press?
Thank you.
.
.
.
Dim btnFirst, btnPrevious, btnNext, btnLast As Buttons 'is this still valid?
.
.
Flag = 1
Max = 100
Index = 5
GetRecord:
' At this point the program finds the record at Index and displays it...
.
.
.
' ...then waits for a button click
Do While Flag <> 0
If btnFirst.Click Then 'problem is here; how do I test?
Index = 1
GoTo GetRecord
End If
If btnPrevious.Click Then
Index = Index - 1
GoTo GetRecord
End If
If btnNext.Click Then
Index = Index + 1
GoTo GetRecord
End If
If btnLast.Click Then
Index = Max
GoTo GetRecord
End If
Loop
.
.
.
Bookmarks