ACC2000: How To Display a Yes/No Field in Two Check Boxes (319480)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q319480
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

SUMMARY

When you create a form based on a table with a Yes/No field, you may prefer to create two check boxes on the form: one to display the Yes selection, and another to display the No selection. This article demonstrates how to create such a form.

MORE INFORMATION

To display Yes and No values in dedicated check boxes, follow these steps:
  1. Create a new, blank database, db1.mdb.
  2. Create a new table with the following properties:
       Table: tblTable1
       ----------------------
       Field Name: City
       Data Type:  text
    
       Field Name: Selection
       Data Type:  Yes/No
    					
  3. Enter the following data in Table1:
       City            Selection
       -------------------------
       Vancouver       Yes
       Los Angeles     No
       Berlin          Yes
    					
  4. Create a new form with the following properties:
       Form: frmTestForm
       ----------------------
       RecordSource: tblTable1
    
       Text box
       ----------------------
       Name: txtItem
       ControlSource: City
    					
  5. Insert an option group in frmTestForm.
  6. In the Option Group Wizard, type Yes and No to create two labels, and then click Next.
  7. Click No, I don't want a default, and then click Next.
  8. Under Values, type -1 for the Yes label and 0 for the No label. Click Next.
  9. Click Store the value in this field; in the drop-down list box, click Selection, and then click Next.
  10. Click to select the Check boxes check box, and then click Finish.
  11. Open your form in Form view, and then test the Option Group control.

REFERENCES

For more information about how to work with option groups, click Microsoft Access Help on the Help menu, type option group in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Modification Type:MinorLast Reviewed:1/7/2006
Keywords:kbinfo KB319480