Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
Welcome to the movie entitled Adding Controls and in this video I want to take you through the process of not only adding Controls, but giving them functionality. Now in a video entitled Form Controls, I talked about the fact that if we create a form and notice I'm going to click on Students, we'll go from square one here, click on Students, click on Form, and I'll just do an Auto Form here, and I'm going to make Property sheet go away. Notice that we end up with a nice cool form here, I'll pull it back, and we can easily move through our form by clicking on the Next button, and the Previous button down here. However, this is not intuitive for users, and it's also small and kind of hard for them to get to, and you'll make your bar pop up at the bottom, and it drives you nuts. So we want to add a Control onto this form, in the standard Windows type Graphical User Interface style, and give the users something to use to move back and forth in their records, so this is going to be a good tutorial on, first of all, dropping controls on here, and giving those controls functionality. Now the first thing you need to notice is that these controls, if you're looking in Layout View, are grouped together, and if I try to drop controls on here, if I click on it, and try to draw, notice it's going to try and put them inside here, in various places alright? And so what I would suggest that you do, is right click, go to Design View, and then we can click on our Controls, and then put them wherever we would like them to be OK? And so that gives me a Command button, and then I can click and get me another Command button, and I will just, draw them about the same size, somewhere around that. We can re-size them a little bit later on, but notice I have Command 35 and 36. Now these are totally useless buttons right now. If I go to Form View, and click them, absolutely nothings happening, so what I want to do now, is save my form, and do you want to save any changes to Students Two, and we'll say Yes, and let's call this Student Controls. Just for an example, and so there's our form, Student Controls, and let's open that up. Now let's go into Design View, and let's talk about what we can do with this. If I click on this button, and I go to the Properties Sheet, you will notice, that if I go to Format, the caption on the button shows as 35, just like I see here. Well I want to change that, I'll click here, and change it to Next. Then when I click anywhere else, it goes to next. I'll click this one, got to the Format Tab, Caption, and I'll say Previous. And, we've at least changed the name of these things. If we right click now, and go to Form View, they at least say the right things, but if I click, they're still not doing anything for us, so let's look at how easy it is to make this happen. Click on the Control, go to Event, and make sure there's nothing here. If there's nothing here in the On Click Method, and I click this little Ellipses, notice it takes me to the Choose Builder Window, and I can choose how I want to build my Code. Let me show you why this is a big deal. If I choose the drop down, and choose Event Procedure and then do this, it drops me straight into the Visual Basic for Applications Code Editor, and I don't want that alright? That's more advanced, so what I'll do is, I'll double click, or triple click here, highlight all that, take it out, again, I've clicked the Button I want to have the action happen on, gone to the Event that I want On Click, clicked on the Ellipses, and I'm going to choose Macro Builder. Here's where it gets easy. I will click on the drop down, and I want to go to a record, choose that, now just answer questions. What's my object type? Well it's a Form. What's the object name? It's Student Controls. What record do you want to go to, when you click the button? Well I can go previous, next, first, last, go to, or new. I will choose Next, and then I will simply close this out, it'll ask me, do you want to save these changes? Yes, and now the magic happens. I right click, I go to Form View, and when I click Next, notice, we jump to the next records. So while we're on a role, let's go do the other one. Click on Previous, I will go to Event On Click, I'll hit the Ellipses with nothing here. It gives me the choice of Macro Builder, I take that, and I scroll down, go to Record, Object type, working on a form, Object name, Student Controls, what record? This one is going to be previous, so I will choose that. Close it. Yes I want to save that. And now, notice what I have if I go to Form View. Next takes me to the next record, Previous takes me back. Now is this doing anything different from this stuff down here? No absolutely not. However, it's a little easier and more intuitive for users to use this OK? And then I want to show you one last thing, very easy now that I have these buttons built, I can get myself some room down here, and I can very easily, move these guys around, so I will grab Previous, drop it down here. I will grab Next, drop it down here next to it, let's put them, kind of close together, go out to my Form View, and notice, now because of the size of my screen and the resolution, I'd have to scroll down to see them, but I can very easily move between them. By moving them around, I haven't changed my Code at all. So that's how I can add functionality, and that's a very basic, very simple example. But kind of work with that, play with it, just get out there, and kind of, click around, and see what other cool stuff you can do by writing those Macros without writing, notice, we didn't write a single bit of VBA Code, but we have some cool functionality.
| Course: | Microsoft Access 2010 |
| Author: | Mark Long |
| SKU: | 34224 |
| ISBN: | 1-936334-91-7 |
| Release Date: | 2011-05-12 |
| Duration: | 9 hrs / 121 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |