1 00:00:00,710 --> 00:00:06,580 So in this video we're going to talk about how to tie code to your user forums that you create. 2 00:00:06,590 --> 00:00:13,160 Because obviously we need some VBA code to be able to actually open this form or to close the forum 3 00:00:13,160 --> 00:00:16,880 or to add the employee that we just created to our table in excel. 4 00:00:16,880 --> 00:00:20,930 So we definitely need to put some VBA into this form before we do that. 5 00:00:20,960 --> 00:00:23,420 I'll talk through this forum really quickly. 6 00:00:23,420 --> 00:00:29,930 We had built a couple of examples in previous videos just of what all of these different controls are. 7 00:00:29,930 --> 00:00:35,390 So this form is built specifically for our Employee table that we have here. 8 00:00:35,390 --> 00:00:42,500 So when I go back to my form I have here I have first name last name start date roll and I put a little 9 00:00:42,500 --> 00:00:48,080 checkbox for full time and I'm going to assume that this box is not checked that the employee is going 10 00:00:48,080 --> 00:00:50,180 to be a part time employee. 11 00:00:50,210 --> 00:00:55,570 I put all of this on a frame and this is just to help organize the form a little bit. 12 00:00:55,580 --> 00:01:00,380 I also change the background color of our regular form and this is something that I typically do just 13 00:01:00,380 --> 00:01:05,210 to help things kind of look a little bit nicer and make it clear what the user is supposed to interact 14 00:01:05,210 --> 00:01:05,480 with. 15 00:01:06,140 --> 00:01:10,340 It's totally up to you if you want to change the background color of things or if you want to put your 16 00:01:10,730 --> 00:01:14,000 objects on a frame or if you just want to put them on your regular form. 17 00:01:14,000 --> 00:01:17,390 It's not going to change anything at all in the code. 18 00:01:17,390 --> 00:01:23,420 So just talking through each of these two you can go ahead and build a similar form the first and last 19 00:01:23,420 --> 00:01:27,710 name are both just regular text box which is this control here. 20 00:01:27,710 --> 00:01:31,730 And I just entered these I made them a little bit longer than the normal text box so that we'd have 21 00:01:31,730 --> 00:01:33,210 some room to type in. 22 00:01:33,260 --> 00:01:38,900 I also made the start date a text box and I left this one a little bit shorter since it shouldn't take 23 00:01:38,900 --> 00:01:41,300 a whole lot of room to give a start date. 24 00:01:41,360 --> 00:01:47,660 The role is a combo box and this is because we will be actually building our dropdown list of our roles 25 00:01:47,960 --> 00:01:50,210 and we'll do that in the VBA code. 26 00:01:50,210 --> 00:01:57,260 And of course the full time down here is a checkbox which is this object here and combo box is this 27 00:01:57,260 --> 00:01:57,960 one. 28 00:01:58,280 --> 00:02:01,880 It's different than this box so make sure that you use combo box. 29 00:02:01,880 --> 00:02:05,290 Otherwise you'll have to use a little bit different code. 30 00:02:05,300 --> 00:02:08,120 You will have to change out combo box rule this box later on. 31 00:02:08,630 --> 00:02:11,720 And then of course we have our two buttons adding close. 32 00:02:11,720 --> 00:02:16,940 And so I need to go through all of these and name them and again like we mentioned before we went to 33 00:02:16,940 --> 00:02:24,050 avoid naming things with spaces or anything like that so I'll call this close button or click on my 34 00:02:24,050 --> 00:02:29,690 Add button and I'll call this Add button and you can see on both of these I change the background color 35 00:02:29,690 --> 00:02:31,640 property which is this property here. 36 00:02:31,740 --> 00:02:37,520 I also changed the font to be bold and I increased the font size to 10 just to make it stand out a little 37 00:02:37,520 --> 00:02:44,600 bit I'll go up to my checkbox here and we'll see a full time check. 38 00:02:44,720 --> 00:02:47,540 We'll go to our last name box. 39 00:02:47,540 --> 00:02:58,620 We'll call this last name text call this one first name text come over here to our start date and we'll 40 00:02:58,620 --> 00:03:00,030 call the start date text 41 00:03:02,960 --> 00:03:07,610 and lastly we have our roll combo. 42 00:03:07,640 --> 00:03:14,240 You can see I'm putting this little tag at the end for combo text box or button or whatever this happens 43 00:03:14,240 --> 00:03:18,140 to be the controller happens to be the reason that I'm doing that is it'll make it a little bit easier 44 00:03:18,140 --> 00:03:19,910 when we're in VBA to remember. 45 00:03:19,910 --> 00:03:20,300 Oh yeah. 46 00:03:20,300 --> 00:03:21,470 This is the text box. 47 00:03:21,470 --> 00:03:25,670 This is how I should interact with the text box and so it'll help us later on if we build that into 48 00:03:25,670 --> 00:03:30,010 our names a little bit or make it easier for us to reference in VBA appropriately. 49 00:03:30,080 --> 00:03:35,930 So I'll go ahead and I'll give you a minute to pause the video and you can go ahead and build this form 50 00:03:36,560 --> 00:03:38,780 and that should have been enough time to pause. 51 00:03:38,780 --> 00:03:43,830 So now we can step into the actual code that gets tied to this user form. 52 00:03:44,000 --> 00:03:49,970 If I go over under forms on the left in our little project Explorer window here and I right click on 53 00:03:49,970 --> 00:03:55,260 this form you can see two options come up you code and you object. 54 00:03:55,310 --> 00:04:01,160 So if I go ahead and save my database really quickly or save my file and then I close out of this form 55 00:04:01,970 --> 00:04:03,470 we can see when I right click on this. 56 00:04:03,470 --> 00:04:04,550 I have two options. 57 00:04:04,550 --> 00:04:07,510 You code or view object if I click on View object. 58 00:04:07,700 --> 00:04:09,350 My form pops back up. 59 00:04:09,350 --> 00:04:16,640 If I right click and select view code irregular code window will pop up and this is just like the module 60 00:04:16,640 --> 00:04:20,310 window that we've been working with in all of our other videos. 61 00:04:20,390 --> 00:04:26,350 But this time we can see this is actually tied directly to our ad employee form which is this form here. 62 00:04:26,390 --> 00:04:32,360 So any code that we put into this ax essentially as a module for this specific form. 63 00:04:32,360 --> 00:04:39,380 So this is where we'll want to do things like clear the form when we open it up or build our list that 64 00:04:39,380 --> 00:04:43,380 should appear in the royal box or tell it what happens when I click add. 65 00:04:43,420 --> 00:04:45,200 And what happens when I click close. 66 00:04:45,320 --> 00:04:47,900 And so that's what we'll be doing in this video. 67 00:04:47,900 --> 00:04:52,220 So we're going to start by building the close buttons code. 68 00:04:52,220 --> 00:04:56,050 So if I click on my close button here we can see we called it closed button. 69 00:04:56,570 --> 00:05:04,340 So over in my module window I'm going to create a private sub and we're gonna stay close button underscore 70 00:05:04,520 --> 00:05:08,130 click Open parentheses close parentheses enter. 71 00:05:08,150 --> 00:05:14,030 So now we can see up here this automatically changes to be the object of our close button and the action 72 00:05:14,030 --> 00:05:15,140 which is click. 73 00:05:15,140 --> 00:05:20,090 And so this matches what we've told the code we want to do here which is our object before the underscore. 74 00:05:20,420 --> 00:05:22,820 And then after the underscore the action that we take. 75 00:05:22,820 --> 00:05:27,430 So this means when we click on our close button this sub is going to run. 76 00:05:27,440 --> 00:05:32,400 So what we want to do here is close the form which we're gonna do by saying unload me. 77 00:05:32,470 --> 00:05:38,030 And what this means is that in our in our code here we're telling it we want to unload an object which 78 00:05:38,030 --> 00:05:41,180 means make it disappear we don't want to see it anymore get it off the screen. 79 00:05:41,210 --> 00:05:46,630 So unload this object and we've told it the object we're interested in unloading is me. 80 00:05:46,640 --> 00:05:52,230 Which means the object that this close button here lives on which is this ad employee form. 81 00:05:52,370 --> 00:05:56,630 And we could hit on this a little bit differently but this works just fine because we know this is always 82 00:05:56,630 --> 00:06:00,290 going to be the object that gets closed when we click on the close button. 83 00:06:00,290 --> 00:06:03,380 So we'll say unload me to close this form. 84 00:06:03,380 --> 00:06:05,900 Now I'm going to go ahead and create a second private sub. 85 00:06:06,380 --> 00:06:12,620 And in this case we're going to look at our Add button and what happens when we click on that add button. 86 00:06:12,660 --> 00:06:17,870 And so what we want this to do is if we go back to our main excel file here we want the Add button to 87 00:06:17,870 --> 00:06:20,900 create a new row in this table and fill it all out. 88 00:06:21,260 --> 00:06:27,050 So right off the bat we can see we're looking at the sixth column is when our table starts. 89 00:06:27,260 --> 00:06:33,650 And if I click into this table and go to table design I can see that I've named this table the employee's 90 00:06:33,710 --> 00:06:34,280 table. 91 00:06:34,520 --> 00:06:38,400 So when I try to reference this table I'm going to call it employees. 92 00:06:38,400 --> 00:06:40,330 It's now going to go back to my code. 93 00:06:40,580 --> 00:06:45,050 Make sure we're clicked into our Add button code here and we're gonna go ahead and we're going to create 94 00:06:45,050 --> 00:06:50,320 some variables so we're going to start with our first name variable which we'll just say is first. 95 00:06:50,490 --> 00:06:57,580 And that's gonna be a string which means text our last name variable will also be text or start date 96 00:06:57,590 --> 00:07:00,320 variable will also be text. 97 00:07:00,320 --> 00:07:02,930 Our role will also be text. 98 00:07:02,930 --> 00:07:09,220 And last but not least we have our full time checkbox and it because this is a checkbox it means or 99 00:07:09,240 --> 00:07:14,990 our value is going to be boolean which means it's either checked or it's not checked there's no gray 100 00:07:14,990 --> 00:07:16,070 area in between. 101 00:07:16,070 --> 00:07:21,080 It's either true which means checked or false which means it's unchecked. 102 00:07:21,080 --> 00:07:26,420 And so we're gonna go ahead and create that full time variable as boolean and what this means is later 103 00:07:26,420 --> 00:07:32,240 on when we go to store this value in our table we're gonna want to do a little bit of a conversion because 104 00:07:32,240 --> 00:07:37,930 we don't want to store that boolean value in our tables so when we initially pull this value it's going 105 00:07:37,930 --> 00:07:41,930 to pull is either true or false and we don't want to put the word. 106 00:07:41,930 --> 00:07:44,990 True or false into our table necessarily. 107 00:07:45,050 --> 00:07:50,810 So we'll do a little conversion that says if this full time variable is true then I want to store the 108 00:07:50,810 --> 00:07:57,830 value full time in my table and if this value is false then I want to store the value part time in my 109 00:07:57,830 --> 00:07:58,670 table. 110 00:07:58,670 --> 00:08:02,930 So we'll get to that when we actually add a row to our table. 111 00:08:03,010 --> 00:08:07,190 The next thing we want to do is actually pull all these values off of our form. 112 00:08:07,270 --> 00:08:11,560 So the way we're going to do that is we're gonna set our first variable which means our first named 113 00:08:11,560 --> 00:08:17,570 variable equal to the first name text box value. 114 00:08:17,590 --> 00:08:22,520 And this first name text if you'll remember is what we named our first name text box here. 115 00:08:22,570 --> 00:08:24,660 I can see this is called First name text. 116 00:08:24,790 --> 00:08:26,920 So that's how I reference it in my code. 117 00:08:26,980 --> 00:08:28,040 We'll keep moving. 118 00:08:28,150 --> 00:08:35,440 So our last name variable is going to equal our last name text box value our start date variable is 119 00:08:35,440 --> 00:08:40,630 going to equal our start date text value. 120 00:08:40,840 --> 00:08:44,680 Our role is going to equal our role. 121 00:08:44,680 --> 00:08:52,930 This one is a combo box if you'll remember value and our full time is going to equal our full time checkbox 122 00:08:53,280 --> 00:08:53,620 value. 123 00:08:53,980 --> 00:08:58,990 So now we've gone ahead and we've pulled each of these values off of the form based on what we named 124 00:08:59,020 --> 00:09:02,360 these particular objects that we're interacting with. 125 00:09:02,380 --> 00:09:08,020 So now we can go back to our actual excel file and add a row to our tables so the first thing we need 126 00:09:08,020 --> 00:09:10,600 to know is what is the sheet name. 127 00:09:10,600 --> 00:09:13,050 And it looks like this is called Sheet 1. 128 00:09:13,090 --> 00:09:15,300 Second thing we'll need to know is what column. 129 00:09:15,310 --> 00:09:17,820 Our table starts and which is column 6. 130 00:09:17,950 --> 00:09:23,390 And the third thing is what is our table name which we determined earlier is employees. 131 00:09:23,530 --> 00:09:28,740 Now go back into my code and I'll go ahead and activate my sheet one worksheet. 132 00:09:28,990 --> 00:09:33,310 So I say worksheets Sheet 1 which is the name of my worksheet that activate. 133 00:09:33,310 --> 00:09:38,220 So now I know everything that's following this is going to assume that I have my sheet 1 activated. 134 00:09:38,410 --> 00:09:42,970 I'm going to go ahead and create a little variable R and I'm going to store it in this variable the 135 00:09:42,970 --> 00:09:46,250 number of roads that are currently in our table. 136 00:09:46,480 --> 00:09:51,370 So we'll say on our worksheet Sheet 1 which we don't really need to do since we just activated this 137 00:09:51,370 --> 00:09:57,330 but just to be safe we'll go ahead and type that out and then we'll say list objects employees. 138 00:09:57,850 --> 00:10:04,480 So now we've referenced our employees table that is on sheet 1 then we want to look at the list rows 139 00:10:04,480 --> 00:10:08,600 which means all of the rows that are in this table and we want you to count them. 140 00:10:08,620 --> 00:10:14,410 So this variable R will tell us how many rows are currently in our table and that does not count the 141 00:10:14,410 --> 00:10:17,970 header row or any of the roads that are before our table. 142 00:10:17,980 --> 00:10:24,100 So if I go back to my cell file or should return the value 1 which means we only have one row of data 143 00:10:24,100 --> 00:10:25,380 in this table right now. 144 00:10:25,840 --> 00:10:30,750 It's not going to count this hetero and it's not going to tell me this blank row exists. 145 00:10:30,880 --> 00:10:35,740 So I know in my code later on I'm probably going to have to account for these two rows here the header 146 00:10:35,740 --> 00:10:37,270 row and the blank row. 147 00:10:37,420 --> 00:10:39,550 I'll go ahead and go back to my code. 148 00:10:39,610 --> 00:10:46,480 Now we want to go ahead and we're gonna want to add a new row to our table to we'll say on sheet 1 We 149 00:10:46,480 --> 00:10:52,330 want to look at the employees object which is our table we want you to look at the rows in that table 150 00:10:52,450 --> 00:10:54,560 and we want you to add a row. 151 00:10:54,670 --> 00:10:59,770 So we'll do that like so and we could have put this before R which probably would have made this a little 152 00:10:59,770 --> 00:11:03,110 bit easier for us but we'll just keep working with how we have it now. 153 00:11:03,190 --> 00:11:07,430 So we know now we're going to have a new row that's created just below. 154 00:11:07,450 --> 00:11:11,260 So we'll be looking for this particular line of our table. 155 00:11:11,260 --> 00:11:16,570 So now I know if I'm trying to reference this cell and I don't want to use it by specifying you know 156 00:11:16,570 --> 00:11:21,550 I'm looking at my table if I just want to use the cells function of my worksheet I know I'm going to 157 00:11:21,550 --> 00:11:28,750 be looking in column 6 and then I know I'm going to want to add to to cover this and I'm going to want 158 00:11:28,750 --> 00:11:36,370 to add one to cover my new row and I'm going to do that to my R value so I know my our value is going 159 00:11:36,370 --> 00:11:41,320 to count the number of rows in my table which is currently 1 row then I'm going to add one for this 160 00:11:41,320 --> 00:11:47,350 blank add one for this had a row and add one again to get to the row that we actually want to interact 161 00:11:47,350 --> 00:11:51,730 with and this will work no matter how many rows we have in our table so let's say we have three rows 162 00:11:51,730 --> 00:11:58,090 in our table again I'm going to want to add one to the blank one for the header and one just to get 163 00:11:58,090 --> 00:12:00,270 to my last row that I've just added. 164 00:12:00,310 --> 00:12:03,010 So this will make sense when we step through the code in a minute. 165 00:12:03,010 --> 00:12:10,540 So what we're going to look at is specifically cells are plus three row. 166 00:12:10,540 --> 00:12:14,830 And again that's one for the blank one for the header and one to get to our new row. 167 00:12:14,830 --> 00:12:20,470 So we've added three and we're going to look in column six which is column X or F which is what we've 168 00:12:20,470 --> 00:12:26,860 just determined is our first column of our table we want the value to be our first name and then we're 169 00:12:26,860 --> 00:12:33,790 just going to step through on the same row step through each column and store our variables that we 170 00:12:33,790 --> 00:12:35,610 just pulled off of our form. 171 00:12:35,620 --> 00:12:41,910 So again our plus three this time column eight the value of the cell should be our start date. 172 00:12:42,310 --> 00:12:46,320 Next we have our role which will be in column 9. 173 00:12:46,570 --> 00:12:51,090 And now we've gotten to our last variable which is this full time variable. 174 00:12:51,190 --> 00:12:56,980 So if I go back to my sheet here this is where we were explaining earlier we don't want to store the 175 00:12:56,980 --> 00:12:57,690 value true. 176 00:12:57,700 --> 00:13:03,050 We don't want the cell to read true or false so we want it to read either full time or part time. 177 00:13:03,110 --> 00:13:08,870 So going to do this using an if statement which we've covered in a previous video so we'll say if our 178 00:13:08,870 --> 00:13:17,930 full time variable equals true then for this cell which is our plus three row tenth column I want that 179 00:13:17,930 --> 00:13:19,690 value to say full time. 180 00:13:19,820 --> 00:13:26,750 So if my full time box is checked if it's true then I want this cell to read full time otherwise or 181 00:13:26,810 --> 00:13:34,850 else I want the cell to read part time and then we'll end that as well and maybe we want to put a little 182 00:13:34,940 --> 00:13:41,750 message box at the bottom here that says the employee has been added to the table and we'll go ahead 183 00:13:41,750 --> 00:13:47,780 and jump past this Button's input we'll just let the OK button be what shows up and we'll title this 184 00:13:47,990 --> 00:13:49,230 success. 185 00:13:49,400 --> 00:13:54,890 So we're going to jump back over to our excel file and we can see in this file we have an ad employee 186 00:13:54,890 --> 00:13:57,450 button here that we haven't really done anything with yet. 187 00:13:57,710 --> 00:14:02,300 And if you don't remember how to add this button there's an Excel controls a video that shows you how 188 00:14:02,300 --> 00:14:08,840 to do this or in the developer tab you can click on insert and go ahead and insert a regular form control 189 00:14:08,840 --> 00:14:14,750 button in our case we'll just leave it as an employee and we'll right click on this and say assign macro 190 00:14:15,050 --> 00:14:19,940 and we can see right now I actually don't have any macros that have been created in our workbook. 191 00:14:19,940 --> 00:14:24,780 Remember that all of the code we've written is tied directly to our form and it's all private. 192 00:14:24,800 --> 00:14:26,720 So we can't reference any of it. 193 00:14:26,720 --> 00:14:32,000 So what we're going to do is cancel out of this window go back to our VBA and we're going to go ahead 194 00:14:32,030 --> 00:14:38,230 and insert a module now we can see this is just defaulted to module one you can rename this if you want 195 00:14:38,230 --> 00:14:39,980 to but it doesn't really matter. 196 00:14:40,000 --> 00:14:46,920 We're going to create a public sub and we'll call this open forum open closed parentheses hit enter. 197 00:14:46,990 --> 00:14:51,710 And this time in this code we want to show our ad employee form. 198 00:14:51,730 --> 00:14:54,310 And remember we've called this form ad employee. 199 00:14:54,310 --> 00:14:57,400 That's the actual name of the form. 200 00:14:57,430 --> 00:15:04,030 So we're going to reference that form directly by typing its name and then we're going to type dot show. 201 00:15:04,030 --> 00:15:10,450 So now when this line runs VBA is going to find this object which is our ad employee form and it's going 202 00:15:10,450 --> 00:15:14,740 to show that object which just means open up this form and show it to the user. 203 00:15:15,010 --> 00:15:16,750 So now I'm going to save this. 204 00:15:17,020 --> 00:15:23,590 Go back to my excel file and in here if I right click on this again and say assign macro we now see 205 00:15:23,590 --> 00:15:27,620 we have this open form macro that showed up so I'm going to highlight that and I'm going to click. 206 00:15:27,630 --> 00:15:31,450 OK now one more thing we're going to do in our code before we move on. 207 00:15:31,480 --> 00:15:36,790 We'll shrink this down a little bit and we'll go back into our ad button code and I'm going to click 208 00:15:36,790 --> 00:15:42,730 just to the left of this first line here and what this does is this will actually pause our code on 209 00:15:42,730 --> 00:15:45,040 this line and bring us into this code. 210 00:15:45,040 --> 00:15:46,390 Windows that we can step. 211 00:15:46,390 --> 00:15:52,290 Line by line through this code and see how it actually interacts with our excel file. 212 00:15:52,300 --> 00:15:53,590 Now go back here. 213 00:15:53,590 --> 00:15:56,620 I'm going to click off of this button in a different cell. 214 00:15:56,620 --> 00:16:01,150 Come back in and now I'm going to click on the ad employee button which we would expect will open our 215 00:16:01,150 --> 00:16:04,490 form and it looks like that's exactly what it's done. 216 00:16:05,000 --> 00:16:07,910 So now I'll just type some dummy values into here. 217 00:16:07,910 --> 00:16:11,590 So what does say first name last. 218 00:16:11,660 --> 00:16:15,590 Say 1 1 20 something like that. 219 00:16:15,590 --> 00:16:20,150 Right now we can see we don't have anything built into our roll combo box so I'm just going to type 220 00:16:20,180 --> 00:16:26,240 a custom value and we'll cover how to create these lists in a different video and we'll go ahead and 221 00:16:26,240 --> 00:16:28,210 say this is a full time employee. 222 00:16:28,220 --> 00:16:34,100 Now if I click close right now just to test things out we see it does close my form automatically I 223 00:16:34,100 --> 00:16:36,260 don't get any sort of message or anything like that. 224 00:16:36,260 --> 00:16:40,910 Now you can build in messages you can build in actions that happen when you click on that close button. 225 00:16:41,270 --> 00:16:44,240 But for our purposes we just wanted it to close out of that form. 226 00:16:44,270 --> 00:16:48,890 So now click at employee again and it will pop our phone back up. 227 00:16:48,890 --> 00:16:59,360 So I'll say first last start date I'll use 120 again we'll just create a custom roll just as an example. 228 00:16:59,400 --> 00:17:01,300 Look check the full time box. 229 00:17:01,310 --> 00:17:07,730 Now when I click add it's going to go ahead and open up our VBA window and we can see it's paused on 230 00:17:07,730 --> 00:17:13,250 our first name line here which is what we expect and we can walk through this step by step to see how 231 00:17:13,250 --> 00:17:15,880 this will actually interact with our excel file. 232 00:17:15,950 --> 00:17:23,360 So I'm going to go ahead and shrink this window over a little bit with this form code over shrink this 233 00:17:23,360 --> 00:17:27,110 down a little and we'll do the same to this file. 234 00:17:27,110 --> 00:17:31,850 Now you'll notice right now if we click in here it's not actually going to let us interact with our 235 00:17:31,850 --> 00:17:37,050 excel file you should get a little sound that makes it clear you're not allowed to click in here. 236 00:17:37,160 --> 00:17:42,950 And that's because the property of this particular form right now is set to true for show modal which 237 00:17:42,950 --> 00:17:47,910 means while this form is open I can't actually interact with my excel file. 238 00:17:47,990 --> 00:17:51,610 So instead we'll just go ahead and shrink this down a little bit more. 239 00:17:52,070 --> 00:17:57,180 And now we can see all of our excel file so we should still be able to see how this code works. 240 00:17:57,230 --> 00:18:00,380 So I'm going to step through this using f eight on my keyboard. 241 00:18:00,380 --> 00:18:06,870 You can also go up to debug and say step into that I'll just use f eight so now I've stepped past this 242 00:18:06,870 --> 00:18:07,290 line. 243 00:18:07,290 --> 00:18:14,880 I can see my first name has pulled the first from this cell last has become last from this cell start 244 00:18:14,880 --> 00:18:21,450 has become our start date we entered role became the role we entered and full time is reading as true 245 00:18:21,480 --> 00:18:25,980 which is what we expect because it's a checkbox and we told it this was going to be a bullion value 246 00:18:25,980 --> 00:18:28,130 which means either true or false. 247 00:18:28,140 --> 00:18:32,880 Now I'm going to go back to my excel file and activate my sheet one which it already is but this is 248 00:18:32,880 --> 00:18:33,720 just a precaution. 249 00:18:33,720 --> 00:18:35,110 So we'll hit F eight. 250 00:18:35,340 --> 00:18:40,500 It's now going to pull the number of rows currently in my table which we would expect would be one. 251 00:18:40,500 --> 00:18:45,600 So we'll hit F eight again and check out this value and it does say one so we know that this is read 252 00:18:45,600 --> 00:18:51,990 correctly we'll press f 8 again we should see a row be added to our table here and it looks like it 253 00:18:51,990 --> 00:18:52,560 has been. 254 00:18:53,010 --> 00:18:58,020 So now we can go ahead and start filling out these values so starting in column F which is column 6 255 00:18:58,410 --> 00:19:05,460 we should see the first name and then seven should see the last name start date roll. 256 00:19:05,700 --> 00:19:07,800 And now we're back to our full time value. 257 00:19:07,800 --> 00:19:12,690 So this is where we built our if statement to say hey if this value equals true we want you to store 258 00:19:12,690 --> 00:19:14,280 the value full time. 259 00:19:14,280 --> 00:19:18,420 If it's false which means the checkboxes unchecked we wanted to read part time. 260 00:19:18,900 --> 00:19:22,210 So if we press f 8 we should see this statement check out. 261 00:19:22,290 --> 00:19:28,140 So the condition is met and it should enter the cells equals full time line and it does so that's good. 262 00:19:28,140 --> 00:19:31,440 So I'll hit update again and we'll see it does read full time. 263 00:19:31,440 --> 00:19:37,380 Now I think again one more time should get your message box that'll pop up and say the employee has 264 00:19:37,380 --> 00:19:42,900 been added to the table will click OK and now we're on and subs will process it one more time to go 265 00:19:42,900 --> 00:19:44,830 ahead and exit out of the code. 266 00:19:45,070 --> 00:19:49,920 Now if I come back and here I can close out of this form and we know everything that we've built has 267 00:19:49,920 --> 00:19:50,880 worked properly. 268 00:19:50,970 --> 00:19:57,210 And next we'll be talking about how to actually assign lists to that combo box.