G
Guest
I have an if statement nesting nightmare. I got the basic statement, which
checks 3 criteria, to work but then I need it to check 2 additional controls
for the same 3 criteria and they are all intertwined because all criteria
essentially need to be checked. I can think thru how it needs to be set up
and nested but the more code I actually have the harder it is to follow and
there has got to be a better way. Can't I somehow set up the basic statements
for the 3 controls and somehow refer them to each other with a GoTo or
something?
If NameofFirsthing is not blank Then
If AmountofFirstthing is blank Then
If StrenghtofFirstthing is blank Then
Cancel, Warn, Refocus
Else If
Set Date, Refocus
End if
Else If
Set Date, Refocus
End If
Else if
Set Date, Refocus
End If
Obviously not true to coding but you get the idea. So, now I have a second &
third thing that need to be checked for all the same criteria whether any of
the criteria of the firstthing were met or not. EEeeeek! Any ideas? I'm
guessing there's a lot easier way to do this.
Any help is appreciated!
Kristine
checks 3 criteria, to work but then I need it to check 2 additional controls
for the same 3 criteria and they are all intertwined because all criteria
essentially need to be checked. I can think thru how it needs to be set up
and nested but the more code I actually have the harder it is to follow and
there has got to be a better way. Can't I somehow set up the basic statements
for the 3 controls and somehow refer them to each other with a GoTo or
something?
If NameofFirsthing is not blank Then
If AmountofFirstthing is blank Then
If StrenghtofFirstthing is blank Then
Cancel, Warn, Refocus
Else If
Set Date, Refocus
End if
Else If
Set Date, Refocus
End If
Else if
Set Date, Refocus
End If
Obviously not true to coding but you get the idea. So, now I have a second &
third thing that need to be checked for all the same criteria whether any of
the criteria of the firstthing were met or not. EEeeeek! Any ideas? I'm
guessing there's a lot easier way to do this.
Any help is appreciated!
Kristine