ACC2000: Bound Combo Box Does Not Display Values

ID: Q223239


The information in this article applies to:
  • Microsoft Access 2000

Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access project (.adp).


SYMPTOMS

After you upsize a form that has a combo box bound to a Yes/No field in a table, the combo box no longer displays data in a Microsoft Access project. When you try to select a value with the combo box, the value that you specify is saved, but it is not displayed.


CAUSE

When you upsize a database to SQL Server or MSDE, Yes/No fields in your tables are automatically converted to bit columns on SQL Server. If you bind a combo box to a bit column in an Access project, you must display and store Boolean values as True or False, not as -1 or 0.


RESOLUTION

Modify the RowSource property of your combo boxes, replacing -1 with True, and 0 with False.


MORE INFORMATION

The following steps reproduce and correct the behavior described in the "Symptoms" section of this article.

Steps to Reproduce Behavior

  1. Create a new database named MyTestDatabase.


  2. Create the following table in the MyTestDatabase database, and then save the table as MyTestTable.



  3. Field Name Data Type Primary Key?
    MyPK Autonumber Yes
    MyChar Text No
    MyYesNo YesNo No
  4. In Design view, add two records to the MyTable table:


  5. MyPK MyChar MyYesNo
    1 First Record Yes
    2 Second Record No
  6. Close the table, and create a new form. Base the form on the MyTable table.


  7. Drag the MyPK and MyChar fields from the field list to the detail section of your new form. (If you cannot see the field list, click Field List on the View menu.)


  8. If the toolbox is not visible, open it by clicking Toolbox on the View menu.


  9. Make sure that the Control Wizards are not active (the button in the toolbox does not appear pressed in), and then select a combo box.


  10. Place the combo box in the detail section of the form.


  11. Modify the properties of the combo box as follows:


  12. Property Name Value
    Control Source MyYesNo
    Row Source Type Value List
    Row Source "True Value";-1;"False Value";0
    Bound Column 2
  13. Save the new form as MyForm.


  14. Open the form in Form view. Note that either "True Value" or "False Value" is displayed in the combo box.


  15. Close the form.


  16. Run the Upsizing Wizard by clicking the Tools menu, pointing to Database Utilities, and then clicking Upsizing Wizard.


  17. Upsize the MyTestDatabase database, choosing to migrate all tables to Create a new client-server application.


  18. After the upsizing process is complete, examine and close the upsizing report. When you close the report, the new Access project that is created for you by the wizard opens automatically.


  19. Open the MyForm form in the Access project. Note that no values are displayed in the combo box.


  20. Open the MyForm form in Design view, and change the Row Source property of the combo box to the following:


  21. 
       "True Value";True;"False Value";False 
  22. Save the form, and then reopen it in Form view. Note that values are now displayed in the combo box.



REFERENCES

For more information about combo boxes, click Microsoft Access Help on the Help menu, type "combo box" in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Additional query words: pra prb

Keywords : kbdta AccessCS
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: June 28, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.