|
-
Sep 6th, 2004, 08:19 PM
#1
Thread Starter
New Member
help on basic order form
Can someone help me on this problem. I am trying to setup an order form where i can get someone to input their name, price and quantity and it will appear in the list box when i hit the calculate button. I want to make sure that the name, the quantity and the price appear too along with the total purchased. How do i go about doing this. I used VB.net and tried it, but i can't get it to work. Please help me again.../
i declare name as string, price as double, and quantity as integer? but when i write the code, it doesn't work.. i can't figure it out.
thanks
-
Sep 6th, 2004, 10:04 PM
#2
you probably want to use text boxes to display your information instead of a list box.
-
Sep 6th, 2004, 10:37 PM
#3
Hyperactive Member
You may want to use a Listview
VB Code:
'put this in your INIT code
'assuming you have
' Col1 as Name/Descriptio
' Col2 as Price
' Col3 as Qty
' Col4 as Amt
lvw1.ListItems.Clear
Set li = lvw1.ListItems.Add(, "totalp")
li.SubItems(3) = "0.00" 'total amt
'in your calculate procedure
Dim li as ListItem
Dim amt as Double
Set li = lvw1.ListItems.Add(, [b]YourUniqueID][/b], Text1)
li.SubItems(1) = Text2 'price
li.SubItems(2) = Text3 'qty
amt = Text2 * Text3
li.SubItems(3) = amt 'amt
lvw1.ListItems("totalp").SubItems(3) = lvw1.ListItems("totalp").SubItems(3) + amt
you can also have a gloval var to hold the total amount so that you will only access once the lisitem's (totalp) subitem(3). say
Code:
lvw1.ListItems("totalp").SubItems(3) = totamt
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|