Join Adam Wilbert for an in-depth discussion in this video Introducing form controls, part of Access 2007: Forms and Reports in Depth.
In this chapter, we're going to be taking a look at each of the control objects that are available to us when working with forms and reports. We've seen a couple of these in the last few movies, but I think it's important to explore each one individually, and see what some of the options we have when working with them. In this movie, we're going to take a look at the selection arrow and the label control. First I'm going to go up to Create tab and then click on Form Design. Now I want to set up this Detail section a little bit. By default Access displays this dot grid in the background, and when working with some of the little controls I think it's going to be a little bit difficult to see, especially if you're viewing this video on a smaller screen such an iPad or an iPhone.
So I am going to adjust these dots a little bit. Let me go up to the Property Sheet and in the Format section, I'm going to scroll down to Grid X and Y. Right now these values are 24. I'm going to set them to 6, so I press 6 and Tab and then 6 and Tab again for the X and Y. That will get rid of most of the dots and I think it'll make this easier to see. Now let's take a look at our first control. In the Controls group of the Design Ribbon, this middle group of buttons, everything between these two lines, are all of the different objects or controls that you can add to your forms.
We're going to be taking a look at this Label one. We will go ahead and click on Label and click once to add a label into our form. Now, when I did that, you'll notice that Access automatically deselected label and it turned on the selection arrow which is this white arrow that's used to select objects. By default, every time you add an object from the Controls panel down into your Detail section, Access will place one instance of that object and then return you back to the selection arrow. My cursor is inside of a new text box, it's flashing, it's waiting for me to type in some text, so I'm just going to type in Text and press Enter. I just added a single label to my form.
Now, most of the other objects when you add them such as text boxes, buttons, some of these other images... When you add them in, you'll get not only the object, but you also get a label with it. The Label button adds labels that aren't attached to any other objects. It's just used for static text. This'll be good for things like titles or descriptions or any kind of instruction that you want to pass on to your end- user that's not dependent on a specific record. The label will create a static bit of text that'll always say the same thing every time you view this form.
To add multiple labels, you can double-click on the Label button and that'll lock it on. Now I can add one label and I'll just write Text again and press Enter and it's locked on, so it still staying as a Label button. I can click again to add another text button, and I'll click again to add a fourth text label. When I am done, I can use the Select button up here to change back to the white arrow and to turn off the label. Now I've added multiple labels to my form. At this point, I can go up to the Arrange tab and we'll look out how we can move these around.
If I drag a box around all of these to select them all, I could use this To Left button to move them all so they align to the left objects. I can say to the Bottom, which will move them all toward the bottom object. I'm going to go ahead and press Ctrl+Z to Undo both of those. I also have an option over here on the left, Control Margins. And if I open up that I've got different settings: None, Narrow, Medium, and Wide. And that controls how close the text is to the edge of the box in the top left corner.
Press, if I click Wide, it'll increase the margin so the text box has actually moved the text outside of the expanded area. Let me go ahead and drag these boxes down a little bit, and since I have them all selected at once, it'll increase the size of all of them at the same time. Now I have expanded my box and I could see that the margin between the text and the edge of the box has been expanded. And just like we saw in the last movie, when we were looking at the alignment--the Left, Middle and Right alignment--there is actually more properties that we have available in the Property Sheet.
So if I look at this Control Margins, I can just choose None, Narrow, Medium, or Wide, but in the Property Sheet, I can actually specify a value that I want. If I scroll down to the bottom of the properties to the Format section, I can set the Top Margin, Bottom Margin, Left and Right Margins to any value that I want. So for instance, I can type in 0.5 to make it half an inch. Again the text moves off the screen a little, so let me expand these out. And so it moved half an inch from the top of the box. This can help you really fine-tune your alignments in setting up your forms.
And the Label control is one of the most common controls that you will be working with when you create your forms and reports. They are pretty much everywhere.
- Designing for the end user
- Organizing form elements
- Formatting a form
- Adding headers
- Linking to external content
- Entering and selecting data
- Adding charts
- Creating a main menu
- Creating a customer form
- Understanding report structure
- Building reports from wizards and queries
- Printing reports