1 00:00:00,720 --> 00:00:06,630 So in our form controls video we talked about all of these different controls that you see on this example 2 00:00:06,630 --> 00:00:10,190 form as well as how to actually insert and create this example form. 3 00:00:10,440 --> 00:00:14,280 And so in this video we're going to be talking a little bit more about this properties we know down 4 00:00:14,280 --> 00:00:16,790 here and what all of these mean. 5 00:00:16,800 --> 00:00:21,480 So the first thing you'll notice is that if I'm clicked onto my user form itself anywhere on my user 6 00:00:21,480 --> 00:00:27,420 form we can see user form one gets highlighted and it tells me appear this is what you're selected. 7 00:00:27,540 --> 00:00:31,460 These are the properties that are associated to our actual user form. 8 00:00:31,650 --> 00:00:37,390 So we can see first of all the name of every object that we have is going to become very important. 9 00:00:37,440 --> 00:00:41,280 The name is what we use to actually reference this object in our code. 10 00:00:41,280 --> 00:00:47,430 So if we wanted to for example open up this form we would need to know the name of this form in order 11 00:00:47,430 --> 00:00:52,280 to do that or if we wanted to find out what the user entered into this text box. 12 00:00:52,410 --> 00:00:55,550 We would need to know the name of this text box to do that. 13 00:00:55,560 --> 00:01:00,590 So we'll start with our user form and we'll go ahead and call this the ad employee form. 14 00:01:00,630 --> 00:01:06,270 And again you probably want to avoid using spaces or special characters or anything like that in your 15 00:01:06,270 --> 00:01:07,280 names. 16 00:01:07,320 --> 00:01:11,810 It's not something that VBA handles particularly well. 17 00:01:11,820 --> 00:01:16,590 So it's generally best to avoid spaces and special characters. 18 00:01:16,590 --> 00:01:19,130 CAPTION is also going to be very important. 19 00:01:19,170 --> 00:01:23,880 This is what's actually going to show up in this blue bar right here so it's not the name of your form 20 00:01:23,940 --> 00:01:31,350 but you typically want it to be pretty close so we'll say ad employee and we can see up here the caption 21 00:01:31,350 --> 00:01:34,020 on my form has changed to match. 22 00:01:34,020 --> 00:01:40,470 Now on your actual form itself you do have some font controls that you can enter font and for color 23 00:01:40,470 --> 00:01:42,960 will be the default color of that font. 24 00:01:42,960 --> 00:01:48,930 So if we just click on the three dots to the right a font really quick we can see we can change the 25 00:01:48,990 --> 00:01:53,940 type of font we can change whether it's bold or in italics or anything like that. 26 00:01:53,940 --> 00:01:59,190 We can change the size of the font so if we change this on our form this will be the default that everything 27 00:01:59,190 --> 00:02:02,990 we enter onto our form will follow this font structure. 28 00:02:03,000 --> 00:02:06,150 You can also change the font of each individual object. 29 00:02:06,150 --> 00:02:12,840 So if I click onto my label for example and then I go into my font property and let's say we make this 30 00:02:12,840 --> 00:02:20,550 a little bit bigger and we make it bold and I click OK we can see just this particular label will update 31 00:02:20,580 --> 00:02:24,390 to match our new font that we just specified and our properties. 32 00:02:24,390 --> 00:02:29,610 Another couple of properties you'll want to pay attention to on your actual form itself is this show 33 00:02:29,610 --> 00:02:31,660 modal property down here. 34 00:02:31,660 --> 00:02:38,460 Now when this property equals true that means that you're user form is modal which means whoever's using 35 00:02:38,460 --> 00:02:44,680 this form has to close out of this form before they can interact with anything else in your Excel file. 36 00:02:44,730 --> 00:02:50,130 If we change this to false it means the user can actually toggle back and forth between this form and 37 00:02:50,130 --> 00:02:56,430 your Excel sheet or this form in different forms without having to actually close out of this particular 38 00:02:56,430 --> 00:02:57,240 form. 39 00:02:57,240 --> 00:02:59,980 So generally this stays on true. 40 00:03:00,180 --> 00:03:04,290 You don't want the user to accidentally lose this form or forget that they have it open and it gets 41 00:03:04,290 --> 00:03:06,260 hidden behind other objects in excel. 42 00:03:06,510 --> 00:03:12,060 So typically you want to leave this on True but if your form requires the user to go reference a couple 43 00:03:12,060 --> 00:03:17,910 of cells in it in your Excel file or if you need two forms open at the same time you'd want to change 44 00:03:17,910 --> 00:03:23,820 the show modal property to be false another thing you might want to pay attention to is controlling 45 00:03:23,820 --> 00:03:26,150 the background color of your actual form. 46 00:03:26,220 --> 00:03:28,910 What you can do with this black color property here. 47 00:03:29,130 --> 00:03:31,370 So we could change his back color to be whatever we want. 48 00:03:31,380 --> 00:03:37,110 So we could change it to be an active border for example and you can see the whole form turns this kind 49 00:03:37,110 --> 00:03:41,010 of light blue color and we can change this to be whatever color we want. 50 00:03:41,010 --> 00:03:46,020 If there's a particular color or something that you're looking for the default color is this button 51 00:03:46,020 --> 00:03:48,120 face color that you see here. 52 00:03:48,210 --> 00:03:52,650 You can also go over to the color palette and that'll give you a little bit more option in choosing 53 00:03:52,650 --> 00:03:57,600 a brighter color or something like that and you can apply colors to anything on your form. 54 00:03:57,600 --> 00:04:03,700 So for example if I go to my ADD button down here we can see I do have a dark color that I can change. 55 00:04:03,960 --> 00:04:09,470 So maybe we want our add button to be green and our close button to be red. 56 00:04:09,540 --> 00:04:15,220 And that'll make it pretty clear to the user right off the bat which button does what so we can see 57 00:04:15,220 --> 00:04:20,890 the other thing that will want to pay attention to is this tab index and what this does is everything 58 00:04:20,890 --> 00:04:23,560 on this form has a tab index value. 59 00:04:23,560 --> 00:04:26,990 So for example this text box has the value of one. 60 00:04:27,100 --> 00:04:30,000 This label has a value of zero. 61 00:04:30,010 --> 00:04:32,730 This combo box says the value of two. 62 00:04:32,860 --> 00:04:34,590 So starting from zero. 63 00:04:34,720 --> 00:04:41,260 If you press tab on your keyboard when you have this form open it's going to walk through the TAB index 64 00:04:41,320 --> 00:04:42,610 value down here. 65 00:04:42,670 --> 00:04:46,570 So will start with our label would have been selected if we hit tab. 66 00:04:46,570 --> 00:04:49,380 It would select our text box if we hit tab again. 67 00:04:49,390 --> 00:04:51,610 It would select this combo box. 68 00:04:51,610 --> 00:04:54,350 And this is value to Soviet tab again. 69 00:04:54,400 --> 00:04:59,470 It will select whichever has value three which looks like this list box and it will continue to walk 70 00:04:59,470 --> 00:05:01,260 through as you click tab. 71 00:05:01,270 --> 00:05:05,470 So this is something you generally want to update at the very end of building your form. 72 00:05:05,470 --> 00:05:06,930 You want to walk through your form. 73 00:05:07,000 --> 00:05:12,820 You want to take the time to make sure the tab order of pressing tab on your keyboard matches the tab 74 00:05:12,850 --> 00:05:15,690 index value of all of the objects on your form. 75 00:05:15,700 --> 00:05:20,170 And that's something that can take a little bit of time to do and you don't want to do this in the middle 76 00:05:20,170 --> 00:05:25,390 of your form in case you end up changing around the order of things later changing around the design 77 00:05:25,390 --> 00:05:26,520 of your form later. 78 00:05:26,530 --> 00:05:30,350 So this is something you'd want to do at the very end of your form. 79 00:05:30,370 --> 00:05:35,830 So while we're looking at our combo box here if I go down on the left here we can see this has some 80 00:05:35,830 --> 00:05:37,190 unique properties. 81 00:05:37,210 --> 00:05:41,350 One you want to pay attention to is the bound column and the column count. 82 00:05:41,350 --> 00:05:45,940 Now what this means is we can actually have multiple columns show up when we click on this dropdown 83 00:05:45,940 --> 00:05:46,450 arrow. 84 00:05:46,600 --> 00:05:52,060 So maybe you're picking the role in this particular box maybe three or four roles are all managerial 85 00:05:52,060 --> 00:05:57,680 roles whereas a couple of your other roles might just be regular employee roles. 86 00:05:57,700 --> 00:06:02,560 So when you click the dropdown you might want to clarify what each role is so maybe you have manager 87 00:06:02,560 --> 00:06:09,730 of design and then you have manager of production and later on you just have regular design role and 88 00:06:09,730 --> 00:06:11,510 a regular production role. 89 00:06:11,530 --> 00:06:16,000 And so what this means is when we click on this drop down menu we can show both of those columns at 90 00:06:16,000 --> 00:06:20,740 the same time so we can change his column count to be whatever we want it to be if you want to show 91 00:06:20,770 --> 00:06:28,000 10 columns you could show 10 columns the bound column chooses which of those columns will actually become 92 00:06:28,000 --> 00:06:30,940 the value that's stored into this combo box. 93 00:06:30,970 --> 00:06:36,580 So for only showing one column obviously that first column is going to be about column whatever we select 94 00:06:36,640 --> 00:06:38,700 is going to be the value of the combo box. 95 00:06:38,800 --> 00:06:43,570 But if you're showing 10 columns you might want to clarify you actually want to store the value that's 96 00:06:43,570 --> 00:06:47,050 in the third column or that in the fourth column that you select. 97 00:06:47,050 --> 00:06:51,050 So bound column and column count can both be very important. 98 00:06:52,230 --> 00:06:57,290 We can also look at locked and visible down here at the very bottom. 99 00:06:57,300 --> 00:07:02,100 Invisible is something that will show up on all of your objects locked will show up on most of your 100 00:07:02,100 --> 00:07:03,120 objects. 101 00:07:03,120 --> 00:07:11,100 So what lock does is it actually changes the interaction of this object to be completely locked or unlocked. 102 00:07:11,130 --> 00:07:17,000 So if we put true for example the user actually won't be able to change what the value of this comeback 103 00:07:17,130 --> 00:07:21,440 combo box is they won't be able to interact with it they won't be able to select anything. 104 00:07:21,570 --> 00:07:26,130 But if we make this false the user will be able to interact with this and select whatever object they 105 00:07:26,130 --> 00:07:27,400 want to. 106 00:07:27,400 --> 00:07:29,170 Same with the visible. 107 00:07:29,230 --> 00:07:31,770 And this again is pretty self-explanatory. 108 00:07:31,770 --> 00:07:33,780 Things are either visible or they're not visible. 109 00:07:33,780 --> 00:07:39,060 So if we change this to false then when we load this form the user won't even see this combo box it'll 110 00:07:39,090 --> 00:07:42,590 be completely off the screen it won't be visible to them at all. 111 00:07:42,690 --> 00:07:45,550 But if it's true they will be able to see this combo box. 112 00:07:45,570 --> 00:07:51,000 So this is the typical sort of value with locked and visible that you might want to change with your 113 00:07:51,000 --> 00:07:52,000 toggle button. 114 00:07:52,140 --> 00:07:57,210 So you might want to toggle on and that would maybe change the visibility property of this combo box 115 00:07:57,210 --> 00:08:01,840 to be true and maybe it would unlock this text box or something like that. 116 00:08:01,920 --> 00:08:05,270 And if you on toggle you might hide this and lock this again. 117 00:08:05,280 --> 00:08:12,630 So this is something that you can change in the VBA you typically want to leave these as true for visible 118 00:08:12,630 --> 00:08:17,580 and false for locked so that your user can actually interact with all of these controls that you've 119 00:08:17,580 --> 00:08:18,900 created. 120 00:08:18,900 --> 00:08:24,680 But it is helpful to know that those exist and you can change them later on if it ever becomes relevant. 121 00:08:24,690 --> 00:08:29,580 So in this video we talked a little bit about this properties window and some of the main properties 122 00:08:29,580 --> 00:08:33,350 you might want to pay attention to as you're going through it and building this form. 123 00:08:33,600 --> 00:08:38,400 And there are a lot of properties that are tied to all of these different possible controls that you're 124 00:08:38,400 --> 00:08:40,160 entering on your form. 125 00:08:40,170 --> 00:08:42,930 And so there's a lot of different things that you might want to do a lot of things you might want to 126 00:08:42,930 --> 00:08:44,390 change. 127 00:08:44,390 --> 00:08:49,590 And if you ever have questions about what any of these actually mean you can find them very easily on 128 00:08:49,590 --> 00:08:50,730 Microsoft's help site. 129 00:08:50,730 --> 00:08:58,110 It's actually a great resource for figuring out what this property is or what this property is and how 130 00:08:58,110 --> 00:09:02,970 changing it would change the way that your form displays and the way that the user interacts with your 131 00:09:02,970 --> 00:09:03,710 form. 132 00:09:03,720 --> 00:09:08,910 So if you ever have questions about any of these properties I highly recommend Microsoft help site but 133 00:09:08,910 --> 00:09:10,730 other than that they're all pretty straightforward. 134 00:09:10,740 --> 00:09:12,300 They're all very similar. 135 00:09:12,300 --> 00:09:17,100 And we've gone over the key properties that you will change most often. 136 00:09:17,100 --> 00:09:18,930 So that's what we covered in this video.