Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Vlissingen, Netherlands
    Posts
    63
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Listindex problem (2000)

    Hi,

    When opening a database i get the following error:
    Run Time Error '7777':
    You've used the ListIndex property incorrectly.
    The error message appeared out of the blue. The app was working OK.

    This is the code which is running:
    Private Sub InitForm()
    LoadFLag = True
    VwTemp (0)
    lstTemp.SetFocus
    lstTemp.ListIndex = 0

    lstViscometers.SetFocus
    lstViscometers.ListIndex = 0
    SampleID.SetFocus
    cmdSelTest.Caption = "Second Test"
    CmdGraphs.Caption = "View Graphs"
    CmdSelect.Visible = False
    CmdCalcFact.Visible = False
    Call BkStyles(1, 0)
    ClrChecks
    lblVisc.Caption = "Viscosity at " & lstTemp.Column(0) & "

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Listindex problem (2000)

    Hello Joop,

    Could the row source of lstViscoMeters be empty? If there are no list items, you can't set the list index to 0.

  3. #3
    Star Lounger
    Join Date
    Apr 2002
    Location
    Vlissingen, Netherlands
    Posts
    63
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Listindex problem (2000)

    Hello Hans,

    Thanks for the prompt reply.
    When running both queries (manually) to fill the list data is displayed.
    VwTemp() is a sub which uses a function to select the query.

    Joop

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Listindex problem (2000)

    Similar code works for me without problems, so I fear it'll be hard to solve this without seeing the database. Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  5. #5
    Star Lounger
    Join Date
    Apr 2002
    Location
    Vlissingen, Netherlands
    Posts
    63
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Listindex problem (2000)

    Hans,

    The zipped version converted to Access 97 format.

    Joop

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Listindex problem (2000)

    I had to change the way the column widths are set; I got an error message in Access 2002. This works for me:

    lstViscometers.ColumnWidths = "0;0.6209 inch;0.4209 inch;0.4209 inch;0.4098 inch;0;0;0;0;"

    (inch instead of in as unit)

    When I tried to open the form, the row source of the list box was empty. This was because my user name didn't occur in the Users table, so the GetUserLoc function returned an empty string. When I added myself to the Users table, with a valid location, the code ran without a problem. So you should probably check whether the user/location combination is valid, and get out if not.

  7. #7
    Star Lounger
    Join Date
    Apr 2002
    Location
    Vlissingen, Netherlands
    Posts
    63
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Listindex problem (2000)

    Thanks for the reply Hans.

    One of the users who is registered in the database can not use it.
    Nevertheless i'll take your advice into account.

    Thanks again,
    Joop

Posting Permissions

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