Results 1 to 17 of 17

Thread: error 7777 during execution

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    VBAX Contributor
    Joined
    Nov 2020
    Location
    Swansea,South Wales,UK
    Posts
    126
    Location
    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?

    Private Sub ListBox1_GotFocus() ' opmerking
        With Me.ListBox1
            .SetFocus
            .listIndex = 0
        End With
    End Sub
    I think I have already mentioned that learning some simple debugging would help you tremendously?
    This would be one of those moments.

    https://www.youtube.com/results?sear...bug+access+vba
    Last edited by Gasman; 07-10-2025 at 11:30 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •