You are on page 1of 2

Private Sub Command1_Click() If list1.ListIndex = -1 Or List2.ListIndex = -1 Then MsgBox "invalid selection" Else If list1.List(list1.ListIndex) = "india" And List2.List(List2.

ListIndex) = "rupee" Then MsgBox "Correct selection" Else If list1.List(list1.ListIndex) = "japan" And List2.List(List2.ListIndex) = "yen" Then MsgBox "Correct selection" Else If list1.List(list1.ListIndex) = "USA" And List2.List(List2.ListIndex) = "dollar" Then MsgBox "Correct selection" Else MsgBox "Incorrect selection" End If End If End If End If End Sub

Private Sub Form_Load() list1.AddItem "india" list1.AddItem "japan" list1.AddItem "USA" List2.AddItem "yen"

List2.AddItem "rupee" List2.AddItem "dollar" End Sub

You might also like