Im trying to make an application that collects how many items were sold and which items they were, I was thinking something like this for checking the upc number, to see if it matches the names in the “files”
Select Case TextBox1.Text
' 0921115150 “Dark Chocolate Truffles”, 2221001501 “ mint mintaways”, 6652300415 “Chocolate Covered Cherries”,
' 0255541028 “Malted Milk Balls”, 0921115141 “Chocolate Covered Raisins “
Case "0921115150 ", " 2221001501 ", " 6652300415 ", " 0255541028 ", " 0921115141 "
MsgBox("Correct #")
Case Else
MsgBox("Must be either: 0921115150 /2221001501 /6652300415 /0255541028 /0921115141 ", MsgBoxStyle.Exclamation) ' Error message displayed
End Select
Thanks to codeorder, he helped me shorten my code for this part
then another textbox to allow how many of that product was sold, and off course a “sold” button.
I was thinking about making a list box that will hold everything, When I hit the sold button it’ll add the upc number, quantity sold, price per quantity, and how much all together that order will cost
Private Sub btnsold_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsold.Click
ListBox1.Items.Add(TextBox1.Text & ":" & TextBox2.Text) ' adds the items to listBox.
End Sub
This is what I was kinda talking about, you can see there are multiple UPC codes that are the same but with different quantities)
UPC Quantity Price Total
0921115150 17 3.50 59.50
2221001501 5 17.25 86.25
6652300415 32 3.25 104.00
2221001501 3 20.00 60.00
0255541028 12 1.85 22.20
0921115150 14 32.56 455.84
2221001501 3 25.26 75.78
I would like it to be saved to a data file (text file). There will be two buttons for this, a save button and a load button, I already know how to do this part, but what I need help on is how do I add things to a listbox in a neat spaced out order and have the price per quantity already in it (after the quantity of course) and be able to multiply how many quantities there is with the price and give a total price for that purchase. Could someone help me out
Or is the calculating things in a list box not possible and I should change my “sold” button a lil bit so when I enter the upc code, it’ll automatically take the quantity of that order and times it by how much it costs and makes a new list on the list box for it, or is that even possible?