VB If statement AND/OR

for simple .. use SELECT CASE

Private Sub txtchange_Change()

Select case Ucase(txtchange.Text)
case "A" : lbloutput.Caption = "Apple"
case "B" : lbloutput.Caption = "Banana"
case "C" : lbloutput.Caption = "Cat"
case "D" : lbloutput.Caption = "Dog"
case "RED" : lbloutput.BackColor = RGB(255, 0, 0)
case Else
  lbloutput.Caption = "Not Found"
End Select

End Sub

Leave a Comment