Dim item As String = InputBox("Enter Item ordered", "Place an order")

Dim quantity As Integer = InputBox("Enter Quantity odered", "Quantity ordered")

Dim price As Integer = InputBox("Enter price", "Price each")
Dim item As String = InputBox("Enter Item ordered", "Place an order")

Dim WrapCharacter As String
WrapCharacter = Chr(13) + Chr(10)
If Where <> 0 Then
     txtSales.Focus()

     txtSales.SelectionStart = Where - 1
     txtSales.SelectionLength = Len(item)
     Do While txtSales.Text = txtSales.Text & "Item : " & item & vbNewLine & "Quantity : " & InStr(txtSales.Text, quantity) + quantity & vbNewLine & "Price :" & price & vbNewLine & WrapCharacter & vbNewLine
     Loop
 Else
     txtSales.Text = txtSales.Text & "Item : " & item & vbNewLine & "Quantity : " & quantity & vbNewLine & "Price :" & price & vbNewLine & WrapCharacter & vbNewLine
 End If

from the above codes I want to reference an Item, if item is in the textbox, it must not be added again, else the quantity to be incremented by the quantity got quantity inputbox and the pcice be the same it items are the same

Edited 2 Years Ago by Reverend Jim: Fixed code formatting

Ok, I have 3 input box on my form there input results goes to one textbox, after every 3 input box a new line is created with an information entred, I want my program to compare what has bein entered in a textbox to input box results and if input box results are the same as data in a textbox, I want my program to tell me how many item are the same wethou printing a new line.

What I'm trying to say is that I need this text box to be checked against input box results, if input box results and text box info are the same, a counter to tell me the occurance of similar items , if they are differend a new line of info to be printed

This question has already been answered. Start a new discussion instead.