A Long Text field is useful for storing large amounts of information, such as notes, comments, and descriptions. The Long Text data type stores up to 65,536 alphanumeric characters. It also supports rich text formatting, such as different colors, fonts, and highlighting.
What do you want to do?
- Add a Long Text field in Datasheet view
- Add a Long Text field in Design view
- Delete a Long Text field
- Long Text field property reference
Add a Long Text field in Datasheet view
You can add a Long Text field in Datasheet View.
Add to an existing table
- Open the table in Datasheet View.
- If necessary, scroll horizontally to the first blank field.
- Select Click to Add, and then select Long Text from the list.
- Double-click the new header row, and then type a meaningful name for the new field.
- Save your changes.
Add to a new table
- On the Create tab, in the Tables group, select Table.
- Select Save. In the Save As dialog box, enter a name for the new table.
- Select Click to Add, and then select Long Text from the list.
- Double-click the new header row, and then type a meaningful name for the new field.
- Save your changes.
Add a Long Text field in Design view
You can add a Long Text field in Design View.
Add to an existing table
- Open the table in Design View.
- In the Field Name column of the designer, enter the name of the Long Text field. For example, "Address," "Notes," or "Comments."
- Select the Data Type column next to the field name, and then choose Long Text from the list.
- Save your changes.
Add to a new table
- On the Create tab, in the Tables group, select Table.
- Right-click the document tab for the new table, and then select Design View on the shortcut menu.
- If the Save As dialog box appears, enter a name for your new table.
- In the Field Name column, select the first blank row and enter a name for the field. Common names include "Comments" or "Notes."
- Select the Data Type column next to the field name, and then choose Long Text from the list.
- Save your changes.
If you bind a form or report text box to your Long Text field, you must also set the Text Format property for the text box to Rich Text.
Set or change Long Text field properties
You can use Datasheet View to set a subset of field properties, such as Is Required or Unique. Use Design View to set all available properties, including Input Mask or Caption.
- Open the table in Design View.
- On the General tab in the lower section of the table designer, under Field Properties, find the property that you want to change.
- Select the field next to the property name. Depending on the property, you can enter data, start the Expression Builder by selecting
, or select an option from a list.
For information about how to use each field property, select the property, and then press F1.
Delete a Long Text field
You can use either Datasheet View or Design View to remove a Long Text field from a table.
Important
When you delete a Long Text field that contains data, you lose that data permanently. You can't undo the deletion. Back up your database before you delete any table fields or other database components.
Delete in Datasheet view
- Open the table in Datasheet View.
- Find the Long Text field, right-click the header row (the name), and then select Delete Field.
- Select Yes to confirm the deletion.
Delete in Design view
- Open the table in Design View.
- Right-click the row selector (the blank square) next to the Long Text field, and then select Delete Rows.
- Select Yes to confirm the deletion.
Long Text field property reference
When you use Design View to add a Long Text field to a table, you can set and change several properties for the field. This table lists the Long Text field properties and describes what each one does, including the results of setting or changing the properties.
| Property | Usage |
|---|---|
| Format | Enter custom formatting characters to define a display format. Formats that you define here appear in datasheets, forms, and reports. |
| Caption | Specifies the name of your Long Text field. This property accepts up to 2,048 characters. If you don't specify a caption, Access applies the default field name. |
| Default Value | Automatically assigns the specified value to this field when a new record is added. For example, if you specify a value such as Enter up to 65 KB of text., it reminds users that they can enter up to 65,536 characters. |
| Validation Rule | Specifies requirements for data entered into a record, field, or control. When you enter data that violates the rule defined for the field, you can use the Validation Text property to specify the resulting error message. Maximum length: 2,048 characters. For more information about using validation rules, see Restrict data input by using a validation rule. |
| Validation Text | Specifies the text in the error message that appears when users violate a validation rule. For more information about creating validation rules, see Restrict data input by using a validation rule. |
| Required | When set to Yes, you must enter a value in the field, or in any controls bound to the field, and the value can't be Null. |
| Allow Zero Length | When set to Yes, you can enter zero-length strings in a field. A zero-length string contains no characters. You use it to indicate that you know no value exists for a field. Enter a zero-length string by typing two double quotation marks with no space between them (""). |
| Indexed | You can use indexes to speed up queries, sorting, and grouping operations that run against large amounts of data. You can also use indexes to prevent users from entering duplicate information. Choices:
|
| Unicode Compression | Access uses Unicode to represent data in Short Text, Long Text, and Hyperlink fields. Unicode takes more storage space because it uses 2 bytes per character instead of 1. To help reduce file size, the default value of the Unicode Compression property for a Short Text, Long Text, or Hyperlink field is Yes. When set to Yes, any character whose first byte is 0 is compressed when it's stored and uncompressed when it's retrieved. Data in a Long Text field isn't compressed unless it requires 4,096 bytes or less of storage space after compression. As a result, the contents of a Long Text field might be compressed in one record, but not in another. |
| IME Mode | Specifies an Input Method Editor, a tool for using English versions of Access with files created in Japanese or Korean. Default value: No Control. For more information about using this property, press F1. |
| IME Sentence Mode | Specifies the type of data that you can enter with an Input Method Editor. For more information about using this property, press F1. |
| Text Format | Enables or disables rich-text editing. Select Rich Text to enable rich-text editing. If you enable rich-text editing for the field and then bind a text box control to the field, you must also enable rich-text editing for the control. For more information about formatting data as rich text, see Create or delete a Rich Text field. |
| Text Align | Specifies the alignment for data in a Long Text field. Choices:
|
| Append Only | Determines whether to track field value changes. There are two settings:
|