Well (to me at least) a Userform is in Excel? A form is in Access? Plus you posted the page down/up for a listbox in the Excel section previously?
So for me at least, I was confused as to what app the code is actually meant to be in?
So what is the value of lngNewTopIndex? What value is the Me.ListBox1.ListCount?
Listbox index starts at 0.
Also, what are you doing with the With?
The whole idea of using with is to not have to use the object name everywhere?
I think I have already mentioned that learning some simple debugging would help you tremendously?Private Sub ListBox1_GotFocus() ' opmerking With Me.ListBox1 .SetFocus .listIndex = 0 End With End Sub
This would be one of those moments.
https://www.youtube.com/results?sear...bug+access+vba






Reply With Quote
