N
Newbie1
I have created a userform and I have an up/down button for moving between
records (rows)
Here is what I have:
Private Sub SpinButton1_SpinDown()
' Need error checking.... Is it the last record???
'if Not Last Record
ActiveCell.Offset(1, 0).Select
'else
' prompt if new record is to be added
'endif
FillMyFormFG
' need to display Record of Record
End Sub
Private Sub SpinButton1_Spinup()
If ActiveCell.Row > 1 Then
ActiveCell.Offset(-1, 0).Select
FillMyFormFG
else
'add in code to beep or let user know BOF has been reached
End If
' need to display Record of Record
End Sub
As you can see from the code, it is fairly simple. But I want to put error
checking in and a counter for what Record of Record. I thought I could use
counta, but I can not figure out how to in VBA.
How would this change if I have some records hidden? I will be using
different filters and would like to move properly and show the correct
record.
Thanks
records (rows)
Here is what I have:
Private Sub SpinButton1_SpinDown()
' Need error checking.... Is it the last record???
'if Not Last Record
ActiveCell.Offset(1, 0).Select
'else
' prompt if new record is to be added
'endif
FillMyFormFG
' need to display Record of Record
End Sub
Private Sub SpinButton1_Spinup()
If ActiveCell.Row > 1 Then
ActiveCell.Offset(-1, 0).Select
FillMyFormFG
else
'add in code to beep or let user know BOF has been reached
End If
' need to display Record of Record
End Sub
As you can see from the code, it is fairly simple. But I want to put error
checking in and a counter for what Record of Record. I thought I could use
counta, but I can not figure out how to in VBA.
How would this change if I have some records hidden? I will be using
different filters and would like to move properly and show the correct
record.
Thanks