There are different data types available in Microsoft Access Database. They are,
- Text
- Memo
- Number
- Date/Time
- Currency
- Auto Number
- Yes/No
- OLE Object
How to Assign Data type?
- Open MS Access, and open the table for which you want to assign a data type to its fields. You have to open the table in Design view to be able to do that. Once you open it, it will list all the fields in the format ‘field name, data type and description’. If you don’t mention any data type while creating the table, it will default it to be text. So all the columns will be listed as text data type before you specifically assign a data type to each field.
- Click on the field you want to assign the data type and click on the data type field. There is a pull down menu which will list all the possible data types as listed above.
- If you know which data type to be assigned to your field, choose that from the pull down menu and move on the next column to be assigned. Keep doing this until you have finished assigning data types to all the fields required.
More Options while assigning data types
- Whenever you choose a data type, you can also choose its size and various other properties which are listed in the box. I have given here an example for data type ‘Text’. This will vary according to the data type you select but all the options are self explanatory and you will not find problem in assigning them.
- Format: You can enter the display layout for the field
- Input Mask: This is a pattern for all data to be entered in this field
- Caption: You can choose to enter a caption for the field to use it in a query
- Field Size: Enter the maximum size your text field can have.
- Default Value: A default value for the field when a new row is created
- Validation Rule: You can choose to enforce validity for the field here.
- Validation Text: Error message that should appear to the user when a prohibited value is entered
- Required: Yes or No value to indicate if a value is must in this field
- Allow Zero length: If zero length fields are allowed in this field
- Indexed: If the column needs to be indexed or not
- Unicode Compression: To allow Unicode compression or not
- IME Code: Which IME code to be used, select from a pull down menu
- IME Sentence Mode: Which sentence mode to be used
- Filling in description field is only optional. It just helps you describe the field. You can see the description which you have entered here in the status bar when you select this field in a query.
- After you assign data types for each and every field, Save and close the table.