Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

In Microsoft Access databases, you can use the Yes/No data type to store a Boolean value, such as True or False, On or Off, Yes or No, and any field that contains only one of two values. This data type often maps to a Check Box control on a form or report.

In this article

Add a Yes/No field in Datasheet view

You can add a Yes/No field to a new or existing table in Datasheet View.

Add to an existing table

  1. Open the table in Datasheet View.

  2. If necessary, scroll horizontally to the first blank field.

  3. Select Click to Add and then select Yes/No from the list.

  4. Double-click the new header row, and then type a meaningful name for the new field.

  5. Save your changes.

Add to a new table

  1. On the Create tab, in the Tables group, click Table.

  2. Click Save, and in the Save As dialog box, enter a name for the new table.

  3. Select Click to Add and then select Yes/No from the list.

  4. Double-click the new header row, and then type a meaningful name for the new field.

  5. Save your changes.

Top of Page

Add a Yes/No field in Design view

You can add a Yes/No field to a new or existing table in Design View.

Add to an existing table

  1. Open the table in Design View.

  2. In the Field Name column, select the first blank row, and then type a name for the field.

  3. Select the adjacent cell in the Data Type column, and then select Yes/No from the list.

  4. Save your changes.

Add to a new table

  1. On the Create tab, in the Tables group, click Table.

  2. Click Save, and in the Save As dialog box, enter a name for the new table.

  3. Right-click the document tab for the new table and click Design View.

  4. In the Field Name column, select the first blank row, and then type a name for the field.

  5. Select the adjacent cell in the Data Type column, and then select Yes/No from the list.

  6. Save your changes.

Top of Page

Set or change Yes/No field properties

You can use Datasheet View to set a subset of field properties, such as Default Value or Name & Caption, but use Design View to set all available properties, including Format or Indexed.

  1. Open the table in Design View.

  2. On the General tab in the lower section of the table designer, under Field Properties, locate the property that you want to change.

  3. Select the field next to the property name. Depending on the property, you can enter data, start the Expression Builder by clicking Builder button, or select an option from a list.

    For information about how to use each field property, select the property and then press F1.

Top of Page

Delete a Yes/No field

Important    When you delete a Yes/No field that contains data, you lose that data permanently — you cannot undo the deletion. For that reason, you should back up your database before you delete any table fields or other database components.

Delete from Datasheet view

  1. Open the table in Datasheet View.

  2. Locate the Yes/No field, right-click the header row (the name), and then click Delete Field.

  3. Click Yes to confirm the deletion.

Delete from Design view

  1. Open the table in Design View.

  2. Click the row selector (the blank square) next to the Text field, and then press DELETE, or right-click the row selector and then click Delete Rows.

  3. Click Yes to confirm the deletion.

Top of Page

Yes/No field property reference

When you use Design View to add a Yes/No field to a table, you can set and change a number of properties for the field. This table shows the Yes/No field properties, describes what each one does, and explains the implications of setting or changing them.

Property

Use

Caption

The label text that is displayed for this field by default in forms, reports, and queries. If this property is empty, the name of the field is used. Any text string is allowed.

An effective caption is usually brief.

Default Value

Automatically assigns the specified value to this field when a new record is added.

Format

Determines the way that the field appears when it is displayed or printed in datasheets, or in forms or reports that are bound to the field. Select one of the following:

  • True/False   Displays the value as either True or False.

  • Yes/No   Displays the value as either Yes or No.

  • On/Off   Displays the value as either On or Off.

Indexed

Specifies whether the field has an index. There are three available values:

  • Yes (No duplicates)   Creates a unique index on the field.

  • Yes (Duplicates OK)   Creates a non-unique index on the field.

  • No   Removes any index on the field.

Note: Do not change this property for a field that is used in a primary key.

Although you can create an index on a single field by setting the Indexed field property, some kinds of indexes cannot be created in this manner. For example, you cannot create a multi-field index by setting this property.

Text Align

Specifies the default alignment of text within a control.

Validation Rule

Supplies an expression that must be true whenever you add or change the value in this field. Use in conjunction with the Validation Text property.

Validation Text

Enter a message to display when a value that is entered violates the expression in the Validation Rule property.

Top of Page

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×