Results 1 to 3 of 3

Thread: help on basic order form

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2004
    Posts
    4

    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

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    you probably want to use text boxes to display your information instead of a list box.

  3. #3
    Hyperactive Member dRAMmer's Avatar
    Join Date
    Oct 2001
    Location
    strangelans
    Posts
    463
    You may want to use a Listview
    VB Code:
    1. 'put this in your INIT code
    2. 'assuming you have
    3. '   Col1 as Name/Descriptio
    4. '   Col2 as Price
    5. '   Col3 as Qty
    6. '   Col4 as Amt
    7.   lvw1.ListItems.Clear
    8.   Set li = lvw1.ListItems.Add(, "totalp")
    9.   li.SubItems(3) = "0.00" 'total amt
    10.  
    11. 'in your calculate procedure
    12. Dim li as ListItem
    13. Dim amt as Double
    14.    Set li = lvw1.ListItems.Add(, [b]YourUniqueID][/b], Text1)
    15.    li.SubItems(1) = Text2 'price
    16.    li.SubItems(2) = Text3 'qty
    17.    amt = Text2 * Text3
    18.    li.SubItems(3) = amt 'amt
    19.    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
    live, code and die...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width