Access objects are constructed in a variety of different view modes. Learn how to start working with the Design view for table objects to streamline their build process, and quickly create new fields and select data types.
- [Instructor] All of the objects that we're going to be creating in Access, have multiple ways to work with them. They're called views, and you could switch between the available views using the very first button, here on the Home tab. Let's go ahead and open up our Guest table to activate it. Now this button is actually a split button. The upper portion will toggle between the two most common States, and the bottom portion of the button, will open up a small menu to allow you to switch to other States, if there are any available for the object that you're working with. Now, tables only actually have two different views. We have the Datasheet View, which is what we're looking at right now, but we also have something called Design View.
So let's go ahead and switch to that to see what it looks like. In Design View, the fields for the table are listed down a column here, the very first column. Next we have a column that displays the Data Type for each field. We can see that all the fields in our Guest table are set to the Short Text data type, except for the very first field, the ID, which is the AutoNumber data type. The third column is a place where we can put in a description for the type of data that goes here. This is a great place to store any notes or reminders about each field. It can be a very useful reference for when you come back to edit your tables later. For instance, I can add a description to the phone number here at the bottom, and I'll just type in 9 digit phone number plus country code.
We can also add or modify the fields that make up our table here in Design view. In many respects, it's actually easier to create a table in Design view than it is in the Datasheet view like we did earlier. If I want to add a postal code field of the phone number, all I need to do is click on the phone number field here on the left, to select it, and either come up to the top and press the Insert Rows button, or I can just right click on that area and choose Insert Rows from the pop-up menu. That will insert a new blank row above, and I can type in the new field name of PostalCode.
I'll press the Tab key to move over to the Data Type, and using the drop down menu, can have the same choices that we've seen earlier in the course. Once again, I'll save this as a Short Text. And for the Description, I'll type in Zip or international postal code. We can switch our view to the Data Sheet view to see what that looks like. I'll come up here and we'll notice we actually have a duplicate of the button here on the left side of the Design tab, and it's the same button that we can find on the Home tab in the same position. I'll go ahead and click the top of it to switch into Datasheet view, and now Access is gonna prompt me to save the table.
This is because we're making a structural change to the design of the table. Let's go ahead and save it, and I'll switch our view. We can see the new PostalCode column has been added right here. Now everything is empty, so we have to go through and type in the values for each of our guests. Let's switch our view back into Design view. Another thing we can do is make changes to existing fields. Now when we imported our data from the Excel file, Access added this ID column for us, and set it to the AutoNumber data type. Now, once again I want to be more specific about what this data is, so instead of a field name of just ID, I'm gonna type in GuestID.
We can also alter some of our data types. I'm gonna change the Email Address data type from Short Text to Hyperlink to make it a clickable link. When changing data types, it's okay to upsize the field or translate to a compatible type. But you'll begin truncating your data if you switch to a smaller type or choose one with less precision. In our case, translating from Short Text to Hyperlink isn't gonna result in any data loss, but changing from a decimal data type to an integer would, since integers can only store whole numbers. The gray selection boxes to the left of each field name allow you to grab and rearrange the fields within the table.
Let's go ahead and click on the Email Address here on the left-hand side, and I'm gonna drag and drop it below the phone number. Notice also in this area, we can quickly identify the primary key for the table with this key icon here, which is on the GuestID field. This is the same yellow key icon that we also saw in the relationship screen. This is good information to know, and it's something that's really not readily apparent when looking at the table in Datasheet view. We're going to look at the Design view a little bit more in depth in the next few movies, including the bottom half of the screen, which deals with additional properties for each field.
Now because changing our view is a very common task throughout Access, there are a bunch of additional ways to do it. From the Navigation pane, you can right click on an object and choose your view from the top of the menu. The same thing applies to the Objects name tab, if it's already open. For instance, I can right click on the tab here that says Guests, and I can change my view here at the bottom. We already saw that there's two different buttons on the ribbon, one in the first contextual tab for the object, here it is over here in the Design tab, we also have it on the Home tab here, at the beginning, and then finally, at the very bottom right-hand side of my screen, I have two small icons here that allow me to change my view down there, as well.
So we have lots of different options for toggling between the available views for each object. So let's go ahead and save the changes to the Table that we've made, I'll press Ctrl + S on my keyboard, or you can press the Quick Save icon here in the Quick Access toolbar. And we'll go ahead and switch our view. Now we can see the email address is a hyperlink, we've got our PostalCode field here, and all these changes have been saved to our data table.
- Determine the essential uses for the Trust Center.
- Explore the functions of the database Navigation pane.
- Recognize the fundamentals of entering data when using Access.
- Identify the necessary steps when importing a table when using Access.
- Break down the fundamentals of filtering and sorting table data in Access.
- Identify the method utilized when building queries in Design view.
- Determine the role of forms in Access.
- Examine all of the elements involved in maintaining a database in Access.
- Explore how to properly protect an Access database with a password.