I can't seem to make up my mind on how to manage such cases. Usually, it's option groups or comboboxes where entry is required, or perhaps some kind of logic where the choices are always definite and cannot be left blank/skipped/ignored.
In case of an option group, for example, if I somehow ended up in Case Else, this only means something went horribly wrong with the option group and may or may not been user's doing. Thus, displaying a error message would be likely to be more confusing to the user or just annoy the user ("I already selected the friggin' thing and you're telling me you forgot about it?!?"). On other hand, giving a default value may not be desirable. Neither is silently doing nothing as the logic may later depend on a expected value returned from the Case statement.
I think my indecisiveness stem from the fact that I just have no idea what errors I'm supposed to anticipate, because in all probability, the option groups should already have a value selected. (I should rush to add that there is also the assumption that the logic is not executed before the validation has occurred to make sure the value is present, thus making validating in Case Else redundant).
Currently, I just do this:
So, I'm wide open to any ideas or suggestions here.
In case of an option group, for example, if I somehow ended up in Case Else, this only means something went horribly wrong with the option group and may or may not been user's doing. Thus, displaying a error message would be likely to be more confusing to the user or just annoy the user ("I already selected the friggin' thing and you're telling me you forgot about it?!?"). On other hand, giving a default value may not be desirable. Neither is silently doing nothing as the logic may later depend on a expected value returned from the Case statement.
I think my indecisiveness stem from the fact that I just have no idea what errors I'm supposed to anticipate, because in all probability, the option groups should already have a value selected. (I should rush to add that there is also the assumption that the logic is not executed before the validation has occurred to make sure the value is present, thus making validating in Case Else redundant).
Currently, I just do this:
Code:
....
Case Else
'Should not be here!
End Select
So, I'm wide open to any ideas or suggestions here.