Click here to Skip to main content
16,023,124 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Why when i execute the program listbox1 doesnt contain the values from form 3 and also foodcharge doesnt have value.It only shows me the values from form1.is there any problem in the code?


Dim moviecharge As Double
Dim foodcharge As Double
Dim subtotal As Double
Dim taxes As Double
Dim total As Double

foodcharge = Val(Form3.lblTotaDrinkslFood.Text)
moviecharge = Val(Form1.lblCurrentotal.Text)

subtotal = Val(moviecharge + foodcharge)
taxes = Val(subtotal * 0.19)
total = Val(subtotal + taxes)

lblMoviecharge.Text = moviecharge
lblFoodcharge.Text = foodcharge
lblSubtotal.Text = subtotal
lblTaxes.Text = taxes
lblTotal.Text = total

Me.ListBox1.Items.AddRange(Form3.lsFoodandBaverages.Items)
Me.ListBox1.Items.AddRange(Form1.ListBox3.Items)



Or can somebody tell me how to get the all the values from Listbox to a variable
Posted
Updated 22-Jan-10 11:20am
v3

1 solution

Ummm, pulling data from the controls of another form is bad practice. You should instead use a globally accessible (static) object.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900