Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Once you've created the structure of your database, it's time to enter data into your tables. In chapters 2 and 3, we built four tables and set field properties to constrain the data. Let's enter a few records into our tables and test out our parameters. In this lesson, we are going to refer back to topics from chapters 2 and 3, if you need to review those concepts. Let's start with our SalesReps. Double-click on the table to open it. EmpID is an auto number so press Tab to skip over it, and it will become a 1 as soon as we start typing our last name, Pollock.
Now, we set both first and last names to be required. So, let's test this by skipping the First Name so you can see what happens. Type in the address: 123 Main Street and Ithaca. It already says New York. So, I can skip right over that. The Zip code is 14850. For HomePhone, type in (123) 456-7890. You'll notice, as soon as I start typing the numbers, that the parentheses, spaces and dashes appear automatically.
The CellPhone is (123) 456-7899. For Email address, type in email@example.com, and notice that it's already blue and underlined. It's a hyperlink. If I clicked on it, it would open up Outlook and address an e-mail automatically for me. For the Start Date, we can either click on the calendar and use it, or we can type it in. I am going to click on the calender. I'll go back a couple of months and choose March 1. Now, this employee is still active.
But let's test out the record validation rule we created that specified that the End Date had to be after the Start Date. Enter 2/28/10 and hit Tab. For Salary, type in 12. When we hit Tab, it will put in the Dollar sign and the decimals. Now for the Attachment field, let's put it in the picture of our employee. Right-click on the field and choose Manage Attachments. Click the Add button and navigate to your Exercise Files folder and the picture for apollock and click OK.
The 0 will become 1, and you can have several attachments here as well. Now, hit Tab again, and we are going to skip the Flag. Hit Tab, and it would start a new record, but we got an error message that says, You must enter a value in the 'SalesReps.FirstName' field. So, let's go ahead and click OK and go back to the field that we skipped. Now here's a troubleshooting tip for you. If you're ever working with a table and you get that error message unexpectedly, it's because your cursor is in a blank record and you triggered a required property.
To solve the problem, dismiss the error message, then press the Escape key to get out of it and delete the extra unwanted record. Now, if I come down here to start another record, I get a warning that my Start Date and End Date validation rules are being tripped. Click OK, go back to End Date and delete it. Then Tab through to start another record. Congratulations! You've added your first employee. Now, it's important to notice that all the changes you make to the data in the tables get saved automatically.
Well, changes that we make to the structure of Access objects do need to get saved. Let's close our SalesReps table and make our first customer. Double-click on the Customers table to open it, and we'll enter a few customers. Our ID field is two initials from the company name followed by the ZIP code. This allows us to distinguish between different branches of the same chain. Type in "GP" and then "14850." Our Company name is Gino's Pizza.
The Address is 714, First Avenue. There is no Address2 for now. The City is Ithaca. It already says New York, and the Zip code is 14850. It already has the Country filled in, USA, because we might have customers in other countries. For the Work Phone, type in (123) 789-1234, no Fax. Now, let's scroll over so we have little bit of room to look at the rest of our variables.
Now, for Type, click on the on the dropdown arrow. We created this as a multi-value field. So, we can click on one or both of the options. Now, Gino's Pizza is a restaurant. So, I'll put a check mark in front of it but not in front of Retail. Then click OK. Next, click the dropdown for SalesRep. You'll see the first and last names pulled off of the Employee table using a lookup field. Now, currently the actual information stored in the field is the EmpID number. But this field is set to display our rep's last name to make it easier for people using the database.
Let's go over to our Web Page, www.ginospizza.com. The Contact is Morelli, Gino, and his e-mail address is firstname.lastname@example.org. He doesn't have a DirectPhone. Now, in the Notes field, we can create any notes that help us with our customer. It has up to 65,000 characters, so you've got plenty of room. You can also use Rich Text Formatting, meaning bold, italics and the like.
Type in "Restaurant has been in the family for three generations." Now, let's add an attachment - in this case, a Resellers Contract. Right-click on Documentation > Manage Attachments > click Add. In your Exercise Files, you'll see a Reseller Contract. Go ahead and choose it and click OK. And as before, we'll leave the Flag unchecked.
Press Tab again to create a new record. This is another one for Gino's Pizza, but for their East Ithaca branch. Type in GP14855. Now, I don't have to keep typing in the same information over and over again. If I hold down the Ctrl key and then type a quotation mark, it will copy the information directly above it. Let's go ahead and finish this record. Their Address is 9 Penny Lane, East Ithaca, still NY, 14855, and their phone number is (123) 789-4321.
Now, they are also a Restaurant. Their SalesRep is also Pollack. Their Web site is the same. So, I'll do the same Ctrl+quotation mark to copy it. The Contact's last name is the same, but this is his brother Vince. And it's email@example.com. "Second branch of family restaurant," and then right-click to add their contract, and there you go, two customers.
We'll close the table, and again, it won't ask us to save because Access saves all changes to the data automatically. Now, let's open up the Product table and put in our first product. Type in "pur08" in the SKU and notice that it turns to all caps because we used greater than in the format. The Product is pure. The Size is 8, The Price is 8.99. The Cost is 6.
Now, notice that the Price change the currency, and the cost will too. Then the Profit will fill in automatically because we made a calculated field for it. Press Tab to start another record, PUR16. Also pure. This time let's put in the size that's bad. Let's put in a 12, and we'll get an alert telling us the Bottle ounces must be 8, 16, 32, 64 or 128, the validation rule we created. Then go ahead and change that size to 16. The Price is 10.99, the Cost is $8, and our Profit is also 2.99.
Now, we also need one bulk oil to start with. So, enter in EV128, Extra Virgin olive oil. The Size is 128. The Price is 49.99. The Cost is 34.99, with a $15 profit. Press Tab one more time to create the record and then Close the table. Now, let's put it in order. Double-click on the Orders table.
The order number and the date will fill in automatically, although I can change the data if I need to. Click on Customer and choose the first Gino's. Click on Product and choose EV128 and enter in Quantity 1. If they want more than one item, you would simply repeat these steps for each additional item. Since we are done, Close the table. Congratulations! You've entered data in all of your tables and successfully tested all of your field properties.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.