Page 1 of 1

Need some help with VB

Posted: September 25th, 2004, 10:51 pm
by Shibby
Ok...This is a VB program and i need some help

Check out the pic http://www.miamihost.net/ims/u/Shibby/Pics/untitled.JPG

What i am trying to do is type in a Quantity (lets say 3) then select my Item (lets say Caps) then when i hit add it will * quantity * the price of caps(9.50) then write that out on the form. I know what spaceing i need and all that but i am not sure how to do this...i have tryed many ways....check my code for one failed attempt. I also want to write it to a running total..(but i think i can do that myself...just need help on this part).

Code: Select all


Private Sub cmdAdd_Click()
   Dim AllData As String
   Dim Product As Integer
   
   AllData = Left(cboSalesman, 5)
   
   'pad Salesman 6 spaces
   AllData = AllData & Space(5 - Len(cboSalesman))

   'pad salesman and school
   AllData = AllData & Space(1 - (optWahs))
   AllData = AllData & Space(1 - (optSahs))
   
   'space between salesman and school
   AllData = AllData & " "
   
   If optWahs = True Then
       AllData = AllData & "West Albany"
   Else
       AllData = AllData & "South Albany"
   End If
   
   AllData = AllData & " "
   
   'Quantity = Val(Quantity)
   
   'If Product("Cap $9.50") = Quantity * 9.5 Then
    '   lstProduct.ListIndex = 0
  ' ElseIf Product("Shirt $8.00") = Quantity * 8# Then
   '    lstProduct.ListIndex = 1
   'ElseIf Product("Jacket $25.75") = Quantity * 25.75 Then
    '   lstProduct.ListIndex = 2
   'End If
   
   
   lstAllData.AddItem AllData
   
   'clear controls
   cboSalesman = ""
   optWahs = False
   optSahs = False
   
   txtQuantity.SetFocus
P.S. this is my 2nd program i have made for a VB class i am taking.