• Combo Box

    Author
    Topic
    #462800

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #1179056

      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.

      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.

      • #1179098

        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.

        • #1179099

          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.

          • #1179101

            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.
    • #1179247

      The combo box that I’m trying to work with is in frmStudents and is labeled cblDealerSearch1.

      Thank you in advance!

      • #1179249

        You were almost there. See the attached version.

        • #1179250

          You were almost there. See the attached version.

          That will make life much simpler! THANK YOU.

    Viewing 1 reply thread
    Reply To: Combo Box

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: