So in our form controls video we talked about all of these different controls that you see on this example
form as well as how to actually insert and create this example form.
And so in this video we're going to be talking a little bit more about this properties we know down
here and what all of these mean.
So the first thing you'll notice is that if I'm clicked onto my user form itself anywhere on my user
form we can see user form one gets highlighted and it tells me appear this is what you're selected.
These are the properties that are associated to our actual user form.
So we can see first of all the name of every object that we have is going to become very important.
The name is what we use to actually reference this object in our code.
So if we wanted to for example open up this form we would need to know the name of this form in order
to do that or if we wanted to find out what the user entered into this text box.
We would need to know the name of this text box to do that.
So we'll start with our user form and we'll go ahead and call this the ad employee form.
And again you probably want to avoid using spaces or special characters or anything like that in your
names.
It's not something that VBA handles particularly well.
So it's generally best to avoid spaces and special characters.
CAPTION is also going to be very important.
This is what's actually going to show up in this blue bar right here so it's not the name of your form
but you typically want it to be pretty close so we'll say ad employee and we can see up here the caption
on my form has changed to match.
Now on your actual form itself you do have some font controls that you can enter font and for color
will be the default color of that font.
So if we just click on the three dots to the right a font really quick we can see we can change the
type of font we can change whether it's bold or in italics or anything like that.
We can change the size of the font so if we change this on our form this will be the default that everything
we enter onto our form will follow this font structure.
You can also change the font of each individual object.
So if I click onto my label for example and then I go into my font property and let's say we make this
a little bit bigger and we make it bold and I click OK we can see just this particular label will update
to match our new font that we just specified and our properties.
Another couple of properties you'll want to pay attention to on your actual form itself is this show
modal property down here.
Now when this property equals true that means that you're user form is modal which means whoever's using
this form has to close out of this form before they can interact with anything else in your Excel file.
If we change this to false it means the user can actually toggle back and forth between this form and
your Excel sheet or this form in different forms without having to actually close out of this particular
form.
So generally this stays on true.
You don't want the user to accidentally lose this form or forget that they have it open and it gets
hidden behind other objects in excel.
So typically you want to leave this on True but if your form requires the user to go reference a couple
of cells in it in your Excel file or if you need two forms open at the same time you'd want to change
the show modal property to be false another thing you might want to pay attention to is controlling
the background color of your actual form.
What you can do with this black color property here.
So we could change his back color to be whatever we want.
So we could change it to be an active border for example and you can see the whole form turns this kind
of light blue color and we can change this to be whatever color we want.
If there's a particular color or something that you're looking for the default color is this button
face color that you see here.
You can also go over to the color palette and that'll give you a little bit more option in choosing
a brighter color or something like that and you can apply colors to anything on your form.
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.
So maybe we want our add button to be green and our close button to be red.
And that'll make it pretty clear to the user right off the bat which button does what so we can see
the other thing that will want to pay attention to is this tab index and what this does is everything
on this form has a tab index value.
So for example this text box has the value of one.
This label has a value of zero.
This combo box says the value of two.
So starting from zero.
If you press tab on your keyboard when you have this form open it's going to walk through the TAB index
value down here.
So will start with our label would have been selected if we hit tab.
It would select our text box if we hit tab again.
It would select this combo box.
And this is value to Soviet tab again.
It will select whichever has value three which looks like this list box and it will continue to walk
through as you click tab.
So this is something you generally want to update at the very end of building your form.
You want to walk through your form.
You want to take the time to make sure the tab order of pressing tab on your keyboard matches the tab
index value of all of the objects on your form.
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
of your form in case you end up changing around the order of things later changing around the design
of your form later.
So this is something you'd want to do at the very end of your form.
So while we're looking at our combo box here if I go down on the left here we can see this has some
unique properties.
One you want to pay attention to is the bound column and the column count.
Now what this means is we can actually have multiple columns show up when we click on this dropdown
arrow.
So maybe you're picking the role in this particular box maybe three or four roles are all managerial
roles whereas a couple of your other roles might just be regular employee roles.
So when you click the dropdown you might want to clarify what each role is so maybe you have manager
of design and then you have manager of production and later on you just have regular design role and
a regular production role.
And so what this means is when we click on this drop down menu we can show both of those columns at
the same time so we can change his column count to be whatever we want it to be if you want to show
10 columns you could show 10 columns the bound column chooses which of those columns will actually become
the value that's stored into this combo box.
So for only showing one column obviously that first column is going to be about column whatever we select
is going to be the value of the combo box.
But if you're showing 10 columns you might want to clarify you actually want to store the value that's
in the third column or that in the fourth column that you select.
So bound column and column count can both be very important.
We can also look at locked and visible down here at the very bottom.
Invisible is something that will show up on all of your objects locked will show up on most of your
objects.
So what lock does is it actually changes the interaction of this object to be completely locked or unlocked.
So if we put true for example the user actually won't be able to change what the value of this comeback
combo box is they won't be able to interact with it they won't be able to select anything.
But if we make this false the user will be able to interact with this and select whatever object they
want to.
Same with the visible.
And this again is pretty self-explanatory.
Things are either visible or they're not visible.
So if we change this to false then when we load this form the user won't even see this combo box it'll
be completely off the screen it won't be visible to them at all.
But if it's true they will be able to see this combo box.
So this is the typical sort of value with locked and visible that you might want to change with your
toggle button.
So you might want to toggle on and that would maybe change the visibility property of this combo box
to be true and maybe it would unlock this text box or something like that.
And if you on toggle you might hide this and lock this again.
So this is something that you can change in the VBA you typically want to leave these as true for visible
and false for locked so that your user can actually interact with all of these controls that you've
created.
But it is helpful to know that those exist and you can change them later on if it ever becomes relevant.
So in this video we talked a little bit about this properties window and some of the main properties
you might want to pay attention to as you're going through it and building this form.
And there are a lot of properties that are tied to all of these different possible controls that you're
entering on your form.
And so there's a lot of different things that you might want to do a lot of things you might want to
change.
And if you ever have questions about what any of these actually mean you can find them very easily on
Microsoft's help site.
It's actually a great resource for figuring out what this property is or what this property is and how
changing it would change the way that your form displays and the way that the user interacts with your
form.
So if you ever have questions about any of these properties I highly recommend Microsoft help site but
other than that they're all pretty straightforward.
They're all very similar.
And we've gone over the key properties that you will change most often.
So that's what we covered in this video.