aerohaith
Dec 9th, 2002, 09:07 PM
how do get an item in cobBox1 appear automatically when u search
for an item . so if an item is found then show the item in cobBox1 else show MsgBox.
Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
Dim itemSearch As Integer
Dim itemFound As Boolean
For itemSearch = 0 To (cobProduct.Items.Count - 1)
If (txtSearch.Text) = CStr(cobProduct.Items.Item(itemSearch)) Then
itemFound = True
cobProduct.Items.Item(itemSearch) ' error / this line to be checked
MsgBox(" herryaa") ' a test to indicate item found = true
End If
Next itemSearch
If itemFound = False Then
MsgBox(" product not found", MsgBoxStyle.Exclamation)
txtSearch.Text = ""
End If
End Sub
thank u
for an item . so if an item is found then show the item in cobBox1 else show MsgBox.
Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
Dim itemSearch As Integer
Dim itemFound As Boolean
For itemSearch = 0 To (cobProduct.Items.Count - 1)
If (txtSearch.Text) = CStr(cobProduct.Items.Item(itemSearch)) Then
itemFound = True
cobProduct.Items.Item(itemSearch) ' error / this line to be checked
MsgBox(" herryaa") ' a test to indicate item found = true
End If
Next itemSearch
If itemFound = False Then
MsgBox(" product not found", MsgBoxStyle.Exclamation)
txtSearch.Text = ""
End If
End Sub
thank u