Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2008
    Posts
    59

    Unanswered: Listbox Throwing Up 11 Results as Opposed to 1

    I have created a form with simply a combo box and a listbox. The listbox has a query within it with 2 fields. One is a name field and the other searches for the entry in the combo box and such has criteria
    Code:
    [Forms]![Form1]![Combo0]
    For some reason though the listbox shows 11 records for each record that is in the original table. Why would this be? I know there are 11 different choices in the combo box but I don't know why this would then translate to displaying 11 records in the listbox. Is this a common problem? I'm really stuck on finding the answer to this!

    Thanks
    Russ

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Quote Originally Posted by slaterino
    Is this a common problem? I'm really stuck on finding the answer to this!
    It's a pretty common thing people want to do, called cascading lists. I'd recommend you check out this tutorial on Cascading Lists. HTH!
    Me.Geek = True

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Take the SQL from your Row Source of the combo box and run it. Do you still get 11 records?

    If so, then it is most likely because of relationship involvement... do you have a table in the query that is on the many side of a relationship to the table you are expecting 1 record from?

    BTW, name your stuff. Form1?! Combo0?! God help you when you have numerous objects.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Jan 2009
    Posts
    4

    a little confused by

    "and the other searches for the entry in the combo box and such has criteria "

    I suspect this was vague to you too when you added it. The combo box and listbox are apparently meant to be connected where the listbox is supposed to show more information about the selected entry in the combo box, right? (If not, please explain)

    The answer about the cascading tutorial is probably the right answer. Another possibility is to set a global variable with code when you select an entry in the combo box and write a function to return that value in the criteria of the listbox. Sounds complicated, and is a little but is an option.

Posting Permissions

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