|
-
Apr 28th, 2011, 12:09 PM
#1
Thread Starter
New Member
Invoice form: cannot transfer multiple texts from another form to the same label.
Hello, I am creating an application for a point of sale in a bar in which I have a form (frmTransactions) where there are some radio buttons to be selected (main groupbox), each radio button is exclusive, and some combo boxes in the second groupbox to be ticked, which instead are not exclusive.
In this form I created a 'Print Invoice' button which opens the form invoice (frmInvoice) and there are some labels that display the text shown on the transactions form; although I managed to do fairly easily the part regarding the customers details and the first line regarding the main groupbox, I am now finding some difficulties with the part regarding the rest of the transactions selected in the second groupbox.
My problems is how to display on the same line of the frmInvoice the texts or values (for the quantities) coming from the frmTransactions, as for the second groupbox more than one item may be selected.
To better explain what goes where:
I have this list of items (5) in form of combobox to be selected, I can select more than one item at the time,and I have a numeric up down to select the quantity of the chosen item.
Once an item is selected, all the elements of the line displayed are in game: after the name of the item there is the label of the individual price, and the numeric up down of the quantity. The total price for the item selected is found in the invoice form using the following code in frmInvoice, and the subtotal, VAT and total are found via code in the invoice form as well:
HTML Code:
'Calculate the price for each single item
lblPrice1.Text = lblQty1.Text * lblUnPrice1.Text
lblPrice2.Text = lblQty2.Text * lblUnPrice2.Text
lblPrice3.Text = lblQty3.Text * lblUnPrice3.Text
lblPrice4.Text = lblQty4.Text * lblUnPrice4.Text
lblPrice5.Text = lblQty5.Text * lblUnPrice5.Text
lblPrice6.Text = lblQty6.Text * lblUnPrice6.Text
'Calculate totals
lblSubtotal.Text = Val(lblPrice1.Text) + Val(lblPrice2.Text) + Val(lblPrice3.Text) + Val(lblPrice4.Text) + Val(lblPrice5.Text) + Val(lblPrice6.Text)
lblVAT.Text = Val(lblSubtotal.Text) * 0.2
lblTotal.Text = Val(lblSubtotal.Text) + lblVAT.Text
I am totally new to VB, using Visual Studio 2008 trial and probably I won't understand your answers, but I try to ask anyway 
Thanks in advance for any suggestion,
Luca
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
|