Thu. Sep 19th, 2024
Data Types in Microsoft Access with Examples VBA Access
Data Types in Microsoft Access with Examples VBA Access

Have you ever wonder what is the Data Types In MS Access? Data Types is the classifications that define the value of the field (or variable) in programming. In Access, the data type is same with SQL language for database or Visual Basic for VBA code.

In Access, you can set the data type in the field. Open the table and go to Design view. After you input the field name, you can select the data type.

Tutorial 1. Data Types In Ms Access-1

Data Type Description
Short & Long Text alphanumeric values in text. The difference is in the character length.
Number Numeric values. It is a separate data type for currency.
Date/Time Contains the Date (Day, Month, Year) and Time (hour, minute, second) value.
Currency Monetary values.
AutoNumber The unique value generated by Access for each new record.
Yes/No Only contains Yes or No Value
OLE Object Pictures, graphs, or other ActiveX objects from another Windows-based application.
Hyperlink Text or combinations of text and numbers stored as text and used as a hyperlink address.
Attachment Attached images, spreadsheet files, documents, and other types of supported files to the records in your database.
Calculated Field Results of a calculation which refer to other fields in the same table. You need Expression Builder to create the calculation.
Lookup Displays either a list of values that is retrieved from a table or query. For more information, read LookUp Wizard Tutorial.
Read Also:  Microsoft Access Event Management Template Database

 

The data type determine the value stored and displayed in the fields. In the field properties, in General tab, you can set the Field Size and Format. The example is in Date/Time, you can select the format into ShortDate (MM/DD/YYYY), Medium Date (DD-MMM-YY) or LongTime (HH:MM:SS AM/PM).

Tutorial 2. Data Types In Ms Access-2

However, when you enter the query, macros, and modules, the Data Type will follow the SQL data type. The data type is really useful in programming. Here are some of most popular data type in Access and SQL database.

Data Type Descriptions
VARCHAR Character string with variable value
INTEGER Number. No decimal.
DATE Stores year, month, and day values
STRING Text

You can see the example of data type in Access programming in the picture below.

Tutorial 3. Data Types In Ms Access-3