Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error 7777 (MSACCESS 2003)

    I have a listbox on a form. It contains a list of word documents. Clicking a list item opens up a subform containing data related to the word document OR the user can change the actual word document name. Its with this I have a problem. I am trying to reset the lists listindex property so it finds the new title in the list to then call a listclick

    If I step through the following code in debug mode, no errors occur, however if the program runs through it, Error 7777 occurs, saying I have used the listindex property incorrectly. Any ideas why? Thanks. The slug integer was put in there to kill any listclick events firing in the wrong place, but that does not appear to be the problem

    SLUG = 1

    For x = 0 To Me.SHOWDOCS.ListCount - 1
    If Me.SHOWDOCS.Column(2, x) = Me.Text197 & ".Doc" Then
    Me.SHOWDOCS.SetFocus
    SLUG = 0
    Me.SHOWDOCS.ListIndex = x
    Exit Sub
    End If
    Next

    SLUG = 0

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Error 7777 (MSACCESS 2003)

    Given that you said that when you click an item it opens a subform, I'm assuming this is not a multi-select listbox, so you can use:

    <pre>For x = 0 To Me.SHOWDOCS.ListCount - 1
    If Me.SHOWDOCS.Column(2, x) = Me.Text197 & ".Doc" Then
    ShowDocs = showDocs.itemdata(x)
    Exit Sub
    End If
    Next
    </pre>

    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error 7777 (MSACCESS 2003)

    Thanks very much Mark. That fixed it a treat. Best regards

Posting Permissions

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