I am using VB 6 in order to clear a listbox (lststuff) containing material entered by the user via input boxes. I am trying to utilize a command button which will clear the list for the user. When testing the program, as soon as i click on the command button I receive a "Type mismatch" error. How can I solve this?
This is the code I am using:
[CODE=vb]Private Sub cmdclear_Click( Index As Integer)
Dim warning As String
warning = InputBox("Cauti on! This will DELETE your ENTIRE list. Do you Still wish to Continue", "Be Careful")
If warning Is "Yes" Or "Y" Then
lstStuff.Clear
ElseIf warning Is "No" Or "N" Then
warning = MsgBox("Your list was not cleared", , "List not Cleared")
Else
warning = MsgBox("Respons e not recognized. Please Type 'Yes' Or 'No'", , "Input Error")
End If
End Sub [/CODE]
This is the code I am using:
[CODE=vb]Private Sub cmdclear_Click( Index As Integer)
Dim warning As String
warning = InputBox("Cauti on! This will DELETE your ENTIRE list. Do you Still wish to Continue", "Be Careful")
If warning Is "Yes" Or "Y" Then
lstStuff.Clear
ElseIf warning Is "No" Or "N" Then
warning = MsgBox("Your list was not cleared", , "List not Cleared")
Else
warning = MsgBox("Respons e not recognized. Please Type 'Yes' Or 'No'", , "Input Error")
End If
End Sub [/CODE]
Comment