ACC: Changing Row Source to Table Doesn't Remove Value List

Last reviewed: March 11, 1998
Article ID: Q170983
The information in this article applies to:
  • Microsoft Access versions 7.0, 97

SYMPTOMS

Novice: Requires knowledge of the user interface on single-user computers.

If you try to change the RowSourceType property of a combo box from a value list to a query after the form has been saved, closed, and reopened, the following behavior will occur:

  • The RowSource property will retain the values in the value list.
  • The combo box will contain the values from the query.
  • A new query containing the names in the value list will appear in the Database window.

CAUSE

This behavior occurs if you do not clear out the value list before you try to create the query.

RESOLUTION

Make sure you delete the RowSource property before trying to create the query.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.

  2. Create a new form in Design view not based on any table or query.

  3. Add a combo box to the form using the Combo Box wizard.

  4. On the first screen of the wizard, click the "I will type in the values I want" option, and then click Next.

  5. In Col1, type the following:

        - apples
        - oranges
        - peaches
        - pears
        - grapes
    

  6. Click Finish to close the wizard. Close and save the form.

  7. Reopen the form in Design view, and open the property box for the combo box.

  8. Make the following changes:

        a. In the RowSourceType box, click to select Table/Query.
    

        b. In the RowSource box, click the Build button.
    

        c. In the Query builder, add the Customers table to the query.
    

        d. Drag the CustomerID field to the query grid.
    

        e. Run and then close the query. Click Yes when asked if you want to
           save the changes made to the query and update the property. Note
           that the RecordSource property still shows the value list.
    

        f. Switch the form to Form view and select an item in the combo box
           list. Note that the list now shows the values from the query.
    

        g. Switch to the Database window. Note that a new query has been
           added with the values from the value list.
    

REFERENCES

For more information about creating a value list for a combo box, search the Help Index for "value lists," and then "Find a record by selecting a value from a list."

Keywords          : FmsCmbob kbui
Version           : 7.0 97
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbprb
Solution Type     : Info_Provided


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 11, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.