RP1America
Technical User
I would like to require all fields in a userform to be populated upon the "OK" click event. In addition, I would like one of these field to require a 4-digit input (no more, no less - as it is a year).
1) Is this done in the click event? I've been researching and have come accross something called Before Update, yet I do not understand it.
2) User fills out form, clicks "OK", one entry is not filled out, after the msgbox pops up, how do I take them back to the form to reenter data without going all the way through the original click event?
3) How do I set up my code to start from the top and go down...if the first field is not populated, then msgbox for that field comes up and goes back to form immeidately even if 2 or 3 more fields are not populated further downt the line. I do not want all messages to pop up, rather the first, then they can go correct, click "OK" again, then if they missed another, it would catch the next in line...
4) Also, how do I require the 4-digit year?
Here is the msgbox text for each field. This code is in no way complete, I just do not know how to get to what I am wanting quite yet.
Any ideas are greatly appreciated! Thanks!
1) Is this done in the click event? I've been researching and have come accross something called Before Update, yet I do not understand it.
2) User fills out form, clicks "OK", one entry is not filled out, after the msgbox pops up, how do I take them back to the form to reenter data without going all the way through the original click event?
3) How do I set up my code to start from the top and go down...if the first field is not populated, then msgbox for that field comes up and goes back to form immeidately even if 2 or 3 more fields are not populated further downt the line. I do not want all messages to pop up, rather the first, then they can go correct, click "OK" again, then if they missed another, it would catch the next in line...
4) Also, how do I require the 4-digit year?
Here is the msgbox text for each field. This code is in no way complete, I just do not know how to get to what I am wanting quite yet.
Any ideas are greatly appreciated! Thanks!
Code:
If txtYear = "" Then MsgBox ("Please Enter Year")
If cboQuarter = "" Then MsgBox ("Please Select Quarter")
If txtRT11 = "%" Then MsgBox ("Please Value Commission Options 1 - 7 Percentage Rate")
If txtRT12 = "%" Then MsgBox ("Please Value Commission Options 8 - 11 Percentage Rate")
If txtRT13 = "%" Then MsgBox ("Please Value Commission Options 14, 16 Percentage Rate")
If txtRT14 = "%" Then MsgBox ("Please Value Commission Options 15, 17 Percentage Rate")
If txtRT15 = "%" Then MsgBox ("Please Value DCP Series I Percentage Rate")
If txtRT21 = "%" Then MsgBox ("Please Value Commission Options 1 - 7, DCP Patriot Select Percentage Rate")
If txtRT22 = "%" Then MsgBox ("Please Value Commission Options 8 - 11 Percentage Rate")
If txtRT23 = "%" Then MsgBox ("Please Value Commission Options 14, 16 Percentage Rate")
If txtRT24 = "%" Then MsgBox ("Please Value Commission Options 15, 17 Percentage Rate")
If txtRT25 = "%" Then MsgBox ("Please Value DCP Series I Percentage Rate")