{"id":1259,"date":"2023-04-14T09:44:27","date_gmt":"2023-04-14T08:44:27","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/?page_id=1259"},"modified":"2023-04-14T09:56:26","modified_gmt":"2023-04-14T08:56:26","slug":"microsoft-access","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/data-modelling\/microsoft-access\/","title":{"rendered":"Microsoft Access"},"content":{"rendered":"\n<p>Hopefully at the workplace you will use a full RDBMS such as Oracle, MySQL, MariaDB etc. But you can run SQL commands on Microsoft Access to at least get some experience using them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a database<\/h2>\n\n\n\n<p>Launch Access. From the Home screen click the Blank database to start.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"544\" height=\"292\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094655\/DB32.png\" alt=\"Example Access home screen\" class=\"wp-image-1263\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094655\/DB32.png 544w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094655\/DB32-300x161.png 300w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><figcaption>Example Access home screen<\/figcaption><\/figure><\/div>\n\n\n\n<p>Give the database a name when prompted.<\/p>\n\n\n\n<p>Access then creates a database with a new table to edit already made.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Add columns<\/h2>\n\n\n\n<p>Access has already added a column to work as a key. This is a number field that automatically increments each time you add a record.<\/p>\n\n\n\n<p>Click the dropdown beside \u201cClick to Add\u201d. Here you can see the data types available for the attributes.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"544\" height=\"292\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094744\/DB33.png\" alt=\"Example to add a column\" class=\"wp-image-1264\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094744\/DB33.png 544w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094744\/DB33-300x161.png 300w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><figcaption>Example to add a column<\/figcaption><\/figure><\/div>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Access datatypes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Datatype<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td>Short text<\/td><td>Up to 255 characters with no formatting.<\/td><\/tr><tr><td>Long text<\/td><td>Up to approximately 65,000 characters. Allows html and other formats.<\/td><\/tr><tr><td>Rich text<\/td><td>A short cut to a long text field with formatting options present.<\/td><\/tr><tr><td>Number<\/td><td>Integers that range from -32,768 to 32,767.<\/td><\/tr><tr><td>Large number<\/td><td>Integers that range from -2,147,483,648 to 2,147,483,647.<\/td><\/tr><tr><td>Currency<\/td><td>15 digits to the left of the decimal point and 4 digits to the right. Not rounded off.<\/td><\/tr><tr><td>Attachment<\/td><td>Stores files in the record. Not all extensions allowed.<\/td><\/tr><tr><td>Data and time extended<\/td><td>Increased precision and formatting options<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Common Access datatypes<\/p>\n\n\n\n<p><strong>Access defaults Number fields to use integers. If you want to use floating point numbers you will need to alter the Field Size in the table\u2019s Design View before adding data.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Foreign keys<\/h2>\n\n\n\n<p>Use a number field for the foreign key because all the primary keys in this exercise are the automatically added number fields.<\/p>\n\n\n\n<p>Close any open tables that you want to link together.<\/p>\n\n\n\n<p>Click on the Database Tools menu then choose the Relationships icon.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"544\" height=\"132\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094850\/DB36.png\" alt=\"Relationships button\" class=\"wp-image-1265\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094850\/DB36.png 544w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094850\/DB36-300x73.png 300w\" sizes=\"auto, (max-width: 544px) 100vw, 544px\" \/><figcaption>Relationships button<\/figcaption><\/figure><\/div>\n\n\n\n<p>Click and hold on the ID under Driver, drag the mouse until you are over the DriverID in the link table and release.<\/p>\n\n\n\n<p>In the popup box tick the checkboxes so that deleting the Driver will also delete the matching items in the link table. Click Create and repeat for the VehicleID link. Save the Relationships tab.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"543\" height=\"287\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094921\/DB37.png\" alt=\"Example relationships screen\" class=\"wp-image-1266\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094921\/DB37.png 543w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14094921\/DB37-300x159.png 300w\" sizes=\"auto, (max-width: 543px) 100vw, 543px\" \/><figcaption>Example relationships screen<\/figcaption><\/figure><\/div>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Forms<\/h2>\n\n\n\n<p>To insert data in Access you use forms.<\/p>\n\n\n\n<p>Click on the Create menu and choose Form Wizard from the ribbon.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"291\" height=\"229\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095013\/DB38.png\" alt=\"Example forms wizard\" class=\"wp-image-1267\" \/><figcaption>Example forms wizard<\/figcaption><\/figure><\/div>\n\n\n\n<p>Choose the columns that you want in the form. This will usually be all of them except the ID as that is automatically added by the system.<\/p>\n\n\n\n<p>Then choose whichever layout you prefer.<\/p>\n\n\n\n<p>Give the form a name the choose to either start adding data or change how the form looks. Choose the first option for now.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"291\" height=\"229\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095045\/DB39.png\" alt=\"Example forms wizard final screen\n\" class=\"wp-image-1268\" \/><figcaption>Example forms wizard final screen<br><\/figcaption><\/figure><\/div>\n\n\n\n<p>Forms aren\u2019t just about adding data. You will see existing data too and can edit it.<\/p>\n\n\n\n<p>If you are adding a new record, then use the arrows at the bottom of the screen to move to the end of the records until you are at a blank one.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"541\" height=\"292\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095118\/DB40.png\" alt=\"Example form screen\" class=\"wp-image-1269\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095118\/DB40.png 541w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095118\/DB40-300x162.png 300w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><figcaption>Example form screen<\/figcaption><\/figure><\/div>\n\n\n\n<p>Foreign keys have to exist before they can be used. A way to do this in forms is the combo box. Right click on the form and choose to open it in either Design or Layout view. Add a combo box from the ribbon.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"71\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095221\/DB41.png\" alt=\"Combo box button\" class=\"wp-image-1270\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095221\/DB41.png 730w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095221\/DB41-300x29.png 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><figcaption>Combo box button<\/figcaption><\/figure><\/div>\n\n\n\n<p>In the popup wizard choose the first option to get the value<br>from another table. Choose the table that foreign key is from.<br>Choose the columns that you need, the ID plus some<br>description that makes more sense to the user. Choose how to<br>order the results in the next screen.<\/p>\n\n\n\n<p>Leave the hide ID checkbox ticked and store the value in the<br>foreign key field. Finally give it a Label.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"274\" height=\"200\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095258\/DB42.png\" alt=\"Example combo box wizard\" class=\"wp-image-1271\" \/><figcaption>Example combo box wizard<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Making it look nicer<\/h3>\n\n\n\n<p>Click on the combo box in the form and then view the Properties pane to the right. Under Data -&gt; Row Source you should see something like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT &#091;Vehicle].&#091;ID], &#091;Vehicle].&#091;Number Plate], &#091;Vehicle].&#091;Manufacturer], &#091;Vehicle].&#091;Model] FROM &#091;Vehicle] ORDER BY &#091;Manufacturer], &#091;Model], &#091;Number Plate];\n<\/code><\/pre>\n\n\n\n<p>Change this to something like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT &#091;Vehicle].&#091;ID], &#091;Vehicle].&#091;Number Plate] &amp; \" \" &amp; &#091;Vehicle].&#091;Manufacturer] &amp; \" \" &amp; &#091;Vehicle].&#091;Model] FROM Vehicle ORDER BY &#091;Manufacturer], &#091;Model], &#091;Number Plate]; \n<\/code><\/pre>\n\n\n\n<p>What you\u2019ve done is combine the descriptive results into one column. Now click on the Format tab in the property pane. You want to change the column count from 4 to 2 and alter the width of the new single column.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"316\" height=\"32\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095354\/DB43.png\" alt=\"Example before change\" class=\"wp-image-1272\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095354\/DB43.png 316w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095354\/DB43-300x30.png 300w\" sizes=\"auto, (max-width: 316px) 100vw, 316px\" \/><figcaption>Example before change<\/figcaption><\/figure><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"277\" height=\"33\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/04\/14095410\/DB44.png\" alt=\"\" class=\"wp-image-1273\" \/><figcaption>Example after change<\/figcaption><\/figure><\/div>\n<\/div>\n<\/div>\n\n\n\n<p class=\"nextlink\"><a href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/data-modelling\/sql\/\" data-type=\"page\" data-id=\"1275\">Next: SQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hopefully at the workplace you will use a full RDBMS such as Oracle, MySQL, MariaDB etc. But you can run SQL commands on Microsoft Access to at least get some experience using them. Creating a database Launch Access. From the Home screen click the Blank database to start. Give the database a name when prompted.&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/data-modelling\/microsoft-access\/\">Continue reading <span class=\"screen-reader-text\">Microsoft Access<\/span><\/a><\/p>\n","protected":false},"author":5710,"featured_media":0,"parent":1179,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1259","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/1259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/users\/5710"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/comments?post=1259"}],"version-history":[{"count":4,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/1259\/revisions"}],"predecessor-version":[{"id":1277,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/1259\/revisions\/1277"}],"up":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/1179"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/media?parent=1259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}