Results 1 to 8 of 8

Thread: Combo Box

  1. #1
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a combo box cboDealerSearch1 based off of a table. Is there anyway that I can have it sort [MasterList_Dealers].[AS8DESC] in ascending order? I tried to base the combo box off of a query instead of a table so I could control the sort order but when I did that, it put a different field as the control source, which won't work for this applications. [MasterList_Dealers].[AS8CODE] needs to be the control source. I tried to sort the table in ascending order but it always reverts back to the original order.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='Theresa01' post='795331' date='28-Sep-2009 19:11']I have a combo box cboDealerSearch1 based off of a table. Is there anyway that I can have it sort [MasterList_Dealers].[AS8DESC] in ascending order? I tried to base the combo box off of a query instead of a table so I could control the sort order but when I did that, it put a different field as the control source, which won't work for this applications. [MasterList_Dealers].[AS8CODE] needs to be the control source. I tried to sort the table in ascending order but it always reverts back to the original order.[/quote]
    Try the following:

    - Create a query based on MasterList_Dealers.
    - Add AS8CODE and AS8DESC to the query grid.
    - Clear the Show check box for AS8DESC.
    - Set the sort order for AS8DESC to Ascending.
    - Save this query as (say) qryDealers.
    - The SQL for this query should look like this

    SELECT MasterList_Dealers.AS8CODE
    FROM MasterList_Dealers
    ORDER BY MasterList_Dealers.AS8DESC;

    - Set the Row Source of cboDealerSearch1 to qryDealers.
    - Make sure that the Column Count of the combo box is set to 1.
    - And that Column Widths is blank or contains a single number.

  3. #3
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='795341' date='28-Sep-2009 19:38']Try the following:

    - Create a query based on MasterList_Dealers.
    - Add AS8CODE and AS8DESC to the query grid.
    - Clear the Show check box for AS8DESC.
    - Set the sort order for AS8DESC to Ascending.
    - Save this query as (say) qryDealers.
    - The SQL for this query should look like this

    SELECT MasterList_Dealers.AS8CODE
    FROM MasterList_Dealers
    ORDER BY MasterList_Dealers.AS8DESC;

    - Set the Row Source of cboDealerSearch1 to qryDealers.
    - Make sure that the Column Count of the combo box is set to 1.
    - And that Column Widths is blank or contains a single number.[/quote]

  4. #4
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for your reply Hans.
    That put the AS8CODE in the end user's combo box, which unfortunately make for a bad search as rarely do they know if. I may be going about this wrong. What I'm trying to do is provide the end user with an easy way to search for the customer that they serviced. Ideally, I would like to allow them to start typing and then select the correct customer from the drop down list. The combo box was working well until I realized that the sort order was scrambled because the original table that I imported was sorted by dealer number. I hope that makes sense. Thanks again.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Please provide sufficient information about the table; preferably attach a stripped down and zipped copy of the database:

    • Make a copy of the database (in Access 2000 or 2002-2003 format) and work with that.
    • Remove all database objects (tables, queries, forms, reports, macros and modules) that are not relevant to the problem.
    • In the remaining table(s), remove most records - leave only the minimum number necessary to demonstrate the problem.
    • Remove or modify data of a confidential nature.
    • Perform a compact and repair (Tools/Database Utilities).
    • Make a zip file containing the database.
    • If you have difficulties getting the zip file reasonably small, save the database in Access 97 format and then zip it.
    • Attach the zip file to a reply.

  6. #6
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The combo box that I'm trying to work with is in frmStudents and is labeled cblDealerSearch1.

    Thank you in advance!
    Attached Files Attached Files

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You were almost there. See the attached version.
    Attached Files Attached Files

  8. #8
    Star Lounger
    Join Date
    Mar 2007
    Location
    Dexter, USA
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='795522' date='29-Sep-2009 17:43']You were almost there. See the attached version.[/quote]



    That will make life much simpler! THANK YOU.

Posting Permissions

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