Forms specifically designed for entering data into the system have a couple of properties that can aid in their functionality. In this movie, Adam begins the process of creating a form to enter new records into the Customers table. He combines several of the objects explored in the last chapter including labels, text boxes, and images.
- [Voiceover] So far, we've taken a look at creating navigation forms to move around our database and we've created reference form in our Employee Directory and we've also created a form that looks up orders that include the particular product using the Form Wizard and the Subform control. Let's now create a form that can be used to input records into our data tables. We'll create a form that can be used to capture information about our new customers. In order to get started, I'm going to click on the Customers table here then we'll come up to the Create tab and we'll let Access get us started by pressing on this Form button right here at the top. That creates a basic form here including all of the different fields from the Customers table.
We'll put this into this Layer mode right now and I want to save it at this point. I'll press Control s on the keyboard and we'll call this Customer Data Entry then I want to get out of the Layout View and switch into the Design View. The first thing you want to do is modify the layout of all of our different table fields here so I'm going to come into the labels and we'll start by making those human readable by adding spaces in here between the different words so I'll just double click and we'll click again to add a space between first name, double click and then add a space here between last name, phone, address, city, state are all fine. Go ahead and add a space here in the ZIP code as well and we might as well add a hyphen in email while we're here then I want to select all these fields so I'm going to select all of them by clicking and dragging a box around all of them.
I'll come up here to the Arrange tab and I'll choose from the Size and Space option, To Shortest. That'll make them all the same height over here. Then I'm going to come over here up to the far right of my form and I actually can't see it so I'm going to close the Property sheet. Let's go ahead and select everything once again and I'm going to drag these over so they're not quite so wide, drag them over to about, I don't know, maybe the four and a half inch mark. Right about there or so then let's turn our attention up here to the header section. I'll click up here in the header section over here on the right hand side. If I click over here, it's going to select this Customers label right there which is not what I want so click over here on the right hand side and you'll select the actual header section then we'll go back into the Design tab and open up our Property Sheet again.
I want to make sure that the header section is exactly one inches tall so that it matches the other forms in the database so I'll type a one in here and then we'll come down to the background color, I'll click on the build button here and we're going to choose a very specific color for the H+ Sport database. This is going to be kind of a warm gray color. I'll type in 124 for red, 106 for green and 85 for blue. We'll say Okay and it changes that color here in the background then I'm going to get rid of this generic form icon. I'll click on it and press Delete as well as the label that came with it. I'll select that and press the Delete key.
For consistency sake, we can actually just copy some other elements out of a different form. Let's go ahead and open up our Employee Directory in Design View. I'll right click on it and go straight into Design View then I'll click on the logo, I'll hold down the Shift key and select the title up here on the top and also the button over here, the Return To Main Menu button then I'll press Control c on my keyboard to copy those to the clipboard. We'll switch back over to our Customer Data Entry form, click into the header section to make sure that that's activated and press Control v to paste everything back in then I looked at this earlier, I need to nudge these things about four dots or so to make sure that they line up with the other ones so just being very precise here with my layout.
I can scroll back here and I could flip back and forth between the two tabs and see that these positions are not moving between the two so they're in exactly the same spot. The button on the other hand is moving slightly so let's go ahead and click on that and maybe nudge it down just a square and we can refine that later if we wanted to. In fact, we could actually do that over here in the Format tab of the Property Sheet. Remember, we put the top at .5 inches on the other one and the left hand side I believe was at six inches then let's close the Property Sheet and make sure that our form is the same width. Let me go ahead and check on this one. I'm going to click off of this, check this button here and this width over here or the length hand side is actually 6.4.
I'm going to change that to 6.5 just so that we can precisely align everything here and we'll set this one to 6.5 as well. Let's change the title up here from H+ Sport Employee Directory. It's now the H+ Sport Customer Data Entry. I'll press Enter to finalize that change and then we'll take a look at a few of the properties for the form itself. I'll click on this button here between the two rulers. We'll come over to the Caption property and type in H+ Sport Customer Data Entry. I'll use the down arrow key to come down a few properties. We'll change the Allow Layout View to no and then I'll use the arrow keys to come all the way down to the Record Selectors.
I'll change that to no and the Navigation buttons to no as well. Also the Scroll Bars, that will get switched over to neither. On the Data tab, there's another property I want to take a look at and that's this one here called Data Entry. It's currently set to no and I'm going to double click on it to switch it over to yes. This will make the form so it's only used for entering new records and not for viewing existing records in the Customers table. So that's all the properties I want to change for the form. The last thing I want to do is add in a nice graphic in here into the background. Let's close the Property Sheet for just a moment so I can see my entire form. And I'm actually going to scroll down and just grab this and move it up to about four inches or so just so I can see the whole thing without having to scroll.
Now, I'll be honest, this next step took me a couple of tries in order to get right so you're going to get the benefit of some of my trial and error here but I'm going to come up here to the Design tab and we're going to grab another image control here. What I want is a picture in here in the background but if I apply it as a background image, in fact, by coming up here to the Format tab and choosing Background Image here, it's actually going to put the image into the header section as well as this detail section and what I want to do is actually confine the image to just this detail section here so that's why I'm coming to the Design tab and we're going to grab an image control and we'll place the background image in this way instead.
Now, the next thing we need to do and this is very specific, I need to click and drag out a box. If I just click once, it's actually going to add this image at full size and that's going to mess up some of the arrangements that we've already done on this form so once I dragged out this box here, I'll let go. That'll turn on the Insert Picture dialog box. We can go out to our desktop, find the Exercise Files and in the Chapter 4 folder, we'll find this image here called Customers. Go ahead and say Okay and that gets added in here into this picture. The next thing I need to do is enlarge this box so it fits to the bounding area of this detail section so click here and drag up to the very top.
I'll click here and drag all the way down here to the very bottom. I'll click here and drag all the way here to the left and this one here, I'll click and drag right to the eight and a half inch mark right there. Next, we need to change some of the properties for this image so open up the Property Sheet. We'll go to the Format tab. We'll double check that the Size Mode is set to Zoom which is what I want but I want to change the Picture Alignment so it's tucked in to the upper right corner of the screen here so it'll be attached up there. Next, we'll close the Property Sheet. I'll go over here to the Arrange tab and we're going to send this image to the back of the stacking order so it appears behind all of these text boxes here.
Finally, we're going to come up to Anchoring and we'll choose Stretch Down and then Across. That way, this image scales appropriately when you move it to a different size screen. Now, I'm just going to adjust this height just a little bit. Looks like I was one notch off so I'll move it down just a little bit there and maybe that was a little bit too much. Let's go ahead and click off of this to deselect it. Click on it one more time. Let me scroll down here and see if I can grab that little node right there, move it back up to exactly the four inch mark and then I'll click here and drag this up so it's nice and tight around that edge. Alright, now everything should be pixel perfect. Let's go ahead and press Control s to save that and we'll go ahead and see what this looks like in Form View there and there is the layout of our form.
Now, at this point, we've done a lot of formatting on this form and taken it quite a ways to being something that in my opinion kind of looks fantastic but we have a few more steps to do on the functionality side of things to ensure that the form works as good as it looks.
Then the course dives into reports: creating efficient and readable layouts, grouping data into categories, tying reports to queries, and using conditional formatting rules to highlight key takeaways from the data. Finally, Adam demonstrates how to link forms and reports and print your results, and introduces unique ways to save time filling out paperwork and generating form letters.
- Creating forms with the Form Wizard
- Formatting and aligning form objects
- Combining text boxes
- Adding a header and labels
- Controlling input
- Adding attachments and images
- Linking form controls
- Creating menus and data entry forms for the database
- Building reports
- Creating calculation fields
- Linking forms and reports
- Printing and exporting reports
- Creating a form letter