I have a user form containing some "mandatory fields", I have some current code which saves the file and attaches it to an email, before doing that it checks to see if the mandatory fields have been completed and if not it turns the questions red and pops up a msgbox advising the user to complete the fields
current code:
followed by the rest of the code to save/attach to email etc
To develop this further, I've been asked to add in some additional mandatory fields but these are based on dynamic sections - ie we have a section which asks for the number of people involved, if the user selects 1 person, 1 set of additional fields becomes visible asking for info such as name, address etc, if they select 2 then 2 sections come up etc (up to 3)
There are 4 sections like this, each with the option to add details for up to 3 people.
what I've been asked for is to give each of these sections mandatory fields
so if 1 person is added then they must have a title and surname filled out, if 2 people are added then both additional sections must have title and surname, and so on
I can make this work but not without adding tonnes of lines of code which I fear will impact performance
my thoughts were along the lines of:
adding the rules for each statement after the else..
but I'm relatively new to VBA and sure this is long winded
is there an efficient way to make this work?
many thanks
Bookmarks