{"id":765,"date":"2016-06-09T21:41:29","date_gmt":"2016-06-10T04:41:29","guid":{"rendered":"https:\/\/database.guide\/?p=765"},"modified":"2016-06-09T21:52:58","modified_gmt":"2016-06-10T04:52:58","slug":"microsoft-access-tutorial-part-1-databases-tables-fields","status":"publish","type":"post","link":"https:\/\/database.guide\/microsoft-access-tutorial-part-1-databases-tables-fields\/","title":{"rendered":"Microsoft Access Tutorial (Part 1): Databases, Tables, &#038; Fields"},"content":{"rendered":"<p>This article is Part 1 of the <a href=\"https:\/\/database.guide\/microsoft-access-tutorial\/\">Microsoft Access tutorial<\/a>.<\/p>\n<p>Here&#8217;s what&#8217;s included in this article:<\/p>\n<ul>\n<li>Create a database.<\/li>\n<li>Add a table to the database.<\/li>\n<li>Add four fields to the table, name\/rename them, and set up\u00a0their data type.<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h2>Create a Database<\/h2>\n<p>Let&#8217;s start by\u00a0creating a blank\u00a0<a href=\"https:\/\/database.guide\/what-is-a-database\/\">database<\/a>.<\/p>\n<p>When you first open <a href=\"https:\/\/database.guide\/what-is-microsoft-access\/\">Access<\/a>, a\u00a0welcome screen is displayed. You can create your first database straight from there.<\/p>\n<ol>\n<li>Click <kbd>Blank desktop database<\/kbd><\/li>\n<li>Name the database at the prompt and click <kbd>Create<\/kbd><\/li>\n<\/ol>\n<p>That&#8217;s all there is to it!\u00a0You will now be proud owner of a\u00a0blank database. And it will\u00a0look something like this:<\/p>\n<figure id=\"attachment_106\" aria-describedby=\"caption-attachment-106\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_database_in_access_3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-106\" src=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_database_in_access_3.png\" alt=\"Screenshot of blank database\" width=\"600\" height=\"440\" srcset=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_database_in_access_3.png 600w, https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_database_in_access_3-300x220.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-106\" class=\"wp-caption-text\">This is a newly created blank desktop database. A table has automatically been created. You can now customise this database to your own needs.<\/figcaption><\/figure>\n<p>But you need not\u00a0go to the welcome screen every time you want to create a database. You can also do it from the <kbd>File<\/kbd> menu (from the\u00a0top menu).<\/p>\n<figure id=\"attachment_128\" aria-describedby=\"caption-attachment-128\" style=\"width: 156px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_database_in_access_4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-128\" src=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_database_in_access_4.png\" alt=\"Screenshot of the File tab in MS Access\" width=\"166\" height=\"73\" \/><\/a><figcaption id=\"caption-attachment-128\" class=\"wp-caption-text\">Clicking the &#8220;File&#8221; tab will provide options for creating a new database.<\/figcaption><\/figure>\n<p>For\u00a0more screenshots and detail, see <a href=\"https:\/\/database.guide\/how-to-create-a-database-in-access\/\">How to Create a Database in Access<\/a>.<\/p>\n<h2>Create a Table<\/h2>\n<p>Your new database will already have one <a href=\"https:\/\/database.guide\/what-is-a-table\/\">table<\/a> called <samp>Table1<\/samp>. Access creates this automatically when you create a new database.<\/p>\n<p>Let&#8217;s create another one:<\/p>\n<ol>\n<li>Click <kbd>CREATE<\/kbd> from the Ribbon<\/li>\n<li>Click <kbd>Table<\/kbd><\/li>\n<\/ol>\n<p>Here&#8217;s what that button looks like on the Ribbon:<\/p>\n<figure id=\"attachment_135\" aria-describedby=\"caption-attachment-135\" style=\"width: 568px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-135\" src=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_1.png\" alt=\"Screenshot of the CREATE tab of the Ribbon in Microsoft Access 2013\" width=\"578\" height=\"145\" srcset=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_1.png 578w, https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_1-300x75.png 300w\" sizes=\"auto, (max-width: 578px) 100vw, 578px\" \/><\/a><figcaption id=\"caption-attachment-135\" class=\"wp-caption-text\">Clicking the &#8220;Table&#8221; icon from the &#8220;CREATE&#8221; tab creates a new table.<\/figcaption><\/figure>\n<p>You&#8217;ll now have another\u00a0blank\u00a0table in your database. So you can click that button any time you need to create a new table.<\/p>\n<p>Most Access databases have lots of\u00a0tables. Each table stores a different set of data. For example, you could have a &#8220;Customers&#8221; table that stores\u00a0customer info, a &#8220;Products&#8221; table that stores info on products that you sell, and an &#8220;Orders&#8221; table that stores info on which customers ordered which products.<\/p>\n<p>Now, if this was an Excel spreadsheet, you\u00a0might\u00a0start adding data right about now.<\/p>\n<p>But this is Access.<\/p>\n<p>One of the differences between Access and Excel, is that the tables in Access require some extra setting up\u00a0before you start adding lots of data.<\/p>\n<p>The first thing you need to do is add fields and name them.<\/p>\n<h2>Add Fields to the Table<\/h2>\n<p><a href=\"https:\/\/database.guide\/what-is-a-field\/\">Fields<\/a>\u00a0are basically another name for <a href=\"https:\/\/database.guide\/what-is-a-column\/\">column<\/a>. Fields will store\u00a0the data. You give each field its own name (eg, &#8220;CustomerId&#8221;, &#8220;FirstName&#8221;, &#8220;LastName&#8221; etc).<\/p>\n<p>Now the thing is, when you add a field, you must select a data type for the field. This data type tells Access the type of data that will be stored in that field. By assigning a data type, Access can make sure that nobody enters the wrong type of data into that field. For example, no\u00a0one\u00a0will be able to enter a phone number into the &#8220;FirstName&#8221; field.<\/p>\n<p>Normally, when you create a table, Access creates the first field called <samp>ID<\/samp>\u00a0with a data type of <samp>AutoNumber<\/samp>. It assigns this field as the\u00a0<a href=\"https:\/\/database.guide\/what-is-a-primary-key\/\">primary key<\/a>\u00a0for that table. More about\u00a0primary keys later. \u00a0For now, let&#8217;s create three more fields.<\/p>\n<p>To add each field, click on the <kbd>Click to Add<\/kbd>\u00a0header and select\u00a0the data type (see below for the\u00a0data types to use).<\/p>\n<figure id=\"attachment_138\" aria-describedby=\"caption-attachment-138\" style=\"width: 190px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-138\" src=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_2.png\" alt=\"Screenshot of dropdown list of data types\" width=\"200\" height=\"268\" \/><\/a><figcaption id=\"caption-attachment-138\" class=\"wp-caption-text\">Access requires that you assign each field a data type.<\/figcaption><\/figure>\n<p>Once you\u00a0select a data type, Access will highlight the field header with <samp>Field1<\/samp>. You can type over the top of this to change the field name to something more meaningful.<\/p>\n<p>Once you&#8217;ve added three more fields, you will have four fields. Rename the <samp>ID<\/samp> field to <samp>CustomerId<\/samp> (see below for how to rename fields).<\/p>\n<p>Use the following names and data types:<\/p>\n<table>\n<thead>\n<tr>\n<th scope=\"col\">Field Name<\/th>\n<th scope=\"col\">Data Type<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u00a0CustomerId<\/td>\n<td>\u00a0AutoNumber<\/td>\n<\/tr>\n<tr>\n<td>\u00a0FirstName<\/td>\n<td>\u00a0Short Text<\/td>\n<\/tr>\n<tr>\n<td>\u00a0LastName<\/td>\n<td>Short Text<\/td>\n<\/tr>\n<tr>\n<td>\u00a0DateCreated<\/td>\n<td>Date &amp; Time<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Quick Tip:\u00a0<\/strong>You can also add new fields by\u00a0adding data\u00a0directly into the <a href=\"https:\/\/database.guide\/what-is-a-cell\/\">cell<\/a> underneath the <samp>Click to Add<\/samp> text. Access will assign a data type to the field based on what you enter. So if you enter say, &#8220;Bob&#8221;, Access will probably make it a Short Text field.<\/p>\n<p>If you use this method, be sure to check the data type.\u00a0Access\u00a0can only guess, based on\u00a0what you entered now. It doesn&#8217;t know what data will need to be entered\u00a0in the future.<\/p>\n<p>Also, when you create fields in this manner, Access will name each field\u00a0<samp>Field1<\/samp>, <samp>Field2<\/samp>,\u00a0etc. You can (and probably should) rename these to something more meaningful.<\/p>\n<h3>Renaming Fields<\/h3>\n<p>You can rename fields by right clicking on the field header and selecting \u00a0<kbd>Rename Field<\/kbd>.<\/p>\n<figure id=\"attachment_139\" aria-describedby=\"caption-attachment-139\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-139\" src=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_4.png\" alt=\"Screenshot of contextual dropdown menu for renaming a field\" width=\"600\" height=\"441\" srcset=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_4.png 600w, https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_4-300x221.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-139\" class=\"wp-caption-text\">Right clicking on a field name brings up a contextual menu. From here you can rename the field, delete the field, insert a new field and more.<\/figcaption><\/figure>\n<h3>Changing Data Type<\/h3>\n<p>You can change the data type from the <samp>FIELDS<\/samp> tab in the Ribbon:<\/p>\n<figure id=\"attachment_141\" aria-describedby=\"caption-attachment-141\" style=\"width: 270px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-141\" src=\"https:\/\/database.guide\/wp-content\/uploads\/2016\/05\/how_to_create_a_table_in_access_3.png\" alt=\"Screenshot of the Data Type option in the Ribbon in Access 2013\" width=\"280\" height=\"178\" \/><\/a><figcaption id=\"caption-attachment-141\" class=\"wp-caption-text\">The &#8220;Data Type&#8221; option in the Ribbon allows you to change the data type of a field.<\/figcaption><\/figure>\n<h2>Next Up<\/h2>\n<p>Next, for part 2 of this Access tutorial, we&#8217;ll look at\u00a0<a href=\"https:\/\/database.guide\/microsoft-access-tutorial-part-2-design-view-field-properties-relationships\/\">Design View, Field Properties, &amp; Relationships<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is Part 1 of the Microsoft Access tutorial. Here&#8217;s what&#8217;s included in this article: Create a database. Add a table to the database. Add four fields to the table, name\/rename them, and set up\u00a0their data type.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[11,9,8,33],"class_list":["post-765","post","type-post","status-publish","format-standard","hentry","category-microsoft-access","tag-create-database","tag-create-table","tag-ms-access","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/database.guide\/wp-json\/wp\/v2\/posts\/765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/database.guide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/database.guide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/database.guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/database.guide\/wp-json\/wp\/v2\/comments?post=765"}],"version-history":[{"count":7,"href":"https:\/\/database.guide\/wp-json\/wp\/v2\/posts\/765\/revisions"}],"predecessor-version":[{"id":791,"href":"https:\/\/database.guide\/wp-json\/wp\/v2\/posts\/765\/revisions\/791"}],"wp:attachment":[{"href":"https:\/\/database.guide\/wp-json\/wp\/v2\/media?parent=765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/database.guide\/wp-json\/wp\/v2\/categories?post=765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/database.guide\/wp-json\/wp\/v2\/tags?post=765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}