ACC2000: Changing Row Source to Table Doesn't Remove Value List
ID: Q197597
|
The information in this article applies to:
Novice: Requires knowledge of the user interface on single-user computers.
SYMPTOMS
If you try to change the RowSourceType property of a combo box from a value list to a query after you've saved, closed, and reopened a form, the following behavior occurs:
- The RowSource property of the form will retain the values in the value list.
- The drop-down list of the combo box on the form will contain the values
from the query.
- A new query, named from the values 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
create the query.
RESOLUTION
Make sure you delete the RowSource property before you create the
query.
MORE INFORMATION
Steps to Reproduce Behavior
- Open the sample database Northwind.mdb.
- In the Database window, click Forms under Objects, and then click New. In the New Form dialog box, click Design View, and then click OK.
- Use the Combo Box Wizard to add a combo box to the form. To use the
Combo Box Wizard, click the Control Wizards button in the toolbox
so that it appears pressed in.
- On the first screen of the wizard, click the I will type in the values I want option, and then click Next.
- In Col1, type the following:
- apples
- oranges
- peaches
- pears
- grapes
- Click Finish to close the wizard. Close and save the form.
- Reopen the form in Design view. If the property sheet is not displayed, right-click the combo box, and then click Properties on the shortcut menu.
- Make the following changes:
- In the RowSourceType box, click to select Table/Query.
- In the RowSource box, click the Build (...) button.
- In the Query builder, add the Customers table to the query.
- Drag the CustomerID field to the query grid.
- 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.
- 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.
- 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, click Microsoft Access Help on the
Help menu, type "Find a record by selecting a value from a list" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic.
Additional query words:
Keywords : kbdta FmsCmbob
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: July 15, 1999