A Long Text field can be 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 and 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
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, click Table.
-
Click Save, and 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 Long Text field. For example: “Address”, “Notes” or “Comments”.
-
Click the Data Type column next to the field name and choose Long Text from the list.
-
Save your changes.
Add to a new table
-
On the Create tab, in the Tables group, click Table.
-
Right-click the document tab for the new table and click Design View on the shortcut menu.
-
If the Save As dialog box appears, provide a name for your new table.
-
In the Field Name column, select the first blank row and enter a name for the field. Typically, names such as "Comments" or "Notes" are applied to a Long Text field.
-
Click the Data Type column next to the field name and 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, but 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, locate 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 clicking , 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 and you cannot undo the deletion. You should back up your database before you delete any table fields or other database components.
Delete in Datasheet view
-
Open the table in Datasheet View.
-
Locate the Long Text field, right-click the header row (the name), and click Delete Field.
-
Click 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 click Delete Rows.
-
Click 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 a number of properties for the field. This table lists the Long Text field properties and describes what each one does, including the implications of setting or changing the properties.
Property |
Usage |
---|---|
Format |
Enter custom formatting characters to define a display format. Formats defined here appear in datasheets, forms, and reports. |
Caption |
Specifies the name of your Text field. 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." Doing so would remind users that they can enter 255 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 the article 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 the article 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 cannot 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, and you use them to indicate that you know no value exists for a field. You 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 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 up more storage space because it uses 2 bytes per character instead of one. 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 is stored and uncompressed when it is retrieved. Data in a Long Text field is not 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 might not be compressed in another record. |
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 they type of data 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. You have these choices:
|
Append Only |
Determines whether to track field value changes. There are two settings:
Warning Setting this property to No deletes any existing field value history. |