thetambarineman
Technical User
Hello all,
the following is some code that ive wrote to catch a search for certain elements that exist in a database. The thing is that it contains too many IF...THEN...ELSE statements!
Which isnt conducive to good code.. Can anyone suggest a way around this... Perhaps a case statement???
If List1.Selected(0) = True Then
Data1.Recordset.FindFirst "employer_name='" & List1.Text & "'"
Else
If List1.Selected(1) = True Then
Data1.Recordset.FindFirst "employer_name='" & List1.Text & "'"
Else
If List1.Selected(2) = True Then
Data1.Recordset.FindFirst "employer_name='" & List1.Text & "'"
Else
If List1.Selected(3) = True Then
Data1.Recordset.FindFirst "employer_name='" & List1.Text & "'"
End If
End If
End If
End If
Thanks in advance...
Paul...
the following is some code that ive wrote to catch a search for certain elements that exist in a database. The thing is that it contains too many IF...THEN...ELSE statements!
Which isnt conducive to good code.. Can anyone suggest a way around this... Perhaps a case statement???
If List1.Selected(0) = True Then
Data1.Recordset.FindFirst "employer_name='" & List1.Text & "'"
Else
If List1.Selected(1) = True Then
Data1.Recordset.FindFirst "employer_name='" & List1.Text & "'"
Else
If List1.Selected(2) = True Then
Data1.Recordset.FindFirst "employer_name='" & List1.Text & "'"
Else
If List1.Selected(3) = True Then
Data1.Recordset.FindFirst "employer_name='" & List1.Text & "'"
End If
End If
End If
End If
Thanks in advance...
Paul...