Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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).

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


Keywords: KB319480, kbinfo

↑ Back to the top

Article Info
Article ID : 319480
Revision : 3
Created on : 1/7/2006
Published on : 1/7/2006
Exists online : False
Views : 223