fuzzy
11-17-2009, 02:31 PM
Hi,
I'm a bit of a novice i'm afraid, but i was hoping that someone might be able to help get around a compile error in visual basic.
Details as follows:
I am using code to update a textbox with the values from a number of other textboxes. - my code will only allow me to add the values of 44 textboxes, and rather annoyingly, i want it to add 45..!
Code as follows:
Sub UpdateTotal()
TextBox2.Value = Val(TextBox3.Value) + Val(TextBox4.Value) + Val(TextBox5.Value) + Val(TextBox6.Value) + Val(TextBox7.Value) + Val(TextBox8.Value) + Val(TextBox9.Value) + Val(TextBox10.Value) + Val(TextBox11.Value) + Val(TextBox12.Value) + Val(TextBox13.Value) + Val(TextBox14.Value) + Val(TextBox15.Value) + Val(TextBox16.Value) + Val(TextBox17.Value) + Val(TextBox18.Value) + Val(TextBox19.Value) + Val(TextBox20.Value) + Val(TextBox21.Value) + Val(TextBox22.Value) + Val(TextBox23.Value) + Val(TextBox24.Value) + Val(TextBox25.Value) + Val(TextBox26.Value) + Val(TextBox27.Value) + Val(TextBox28.Value) + Val(TextBox29.Value) + Val(TextBox30.Value) + Val(TextBox31.Value) + Val(TextBox32.Value) + Val(TextBox33.Value) + Val(TextBox34.Value) + Val(TextBox35.Value) + Val(TextBox36.Value) + Val(TextBox37.Value) + Val(TextBox38.Value) + Val(TextBox39.Value) + Val(TextBox40.Value) + Val(TextBox41.Value) + Val(TextBox42.Value) + Val(TextBox43.Value) + Val(TextBox44.Value) + Val(TextBox45.Value) + Val(TextBox46.Value)
End Sub
If i try to add another value to the list, it goes red and won't work, and i get either a "compile error:syntax error" or "compile errror: Expected:line number or label or statement or end of statement".
Hope you can help me,
Thanks,
Fuzz :confused:
I'm a bit of a novice i'm afraid, but i was hoping that someone might be able to help get around a compile error in visual basic.
Details as follows:
I am using code to update a textbox with the values from a number of other textboxes. - my code will only allow me to add the values of 44 textboxes, and rather annoyingly, i want it to add 45..!
Code as follows:
Sub UpdateTotal()
TextBox2.Value = Val(TextBox3.Value) + Val(TextBox4.Value) + Val(TextBox5.Value) + Val(TextBox6.Value) + Val(TextBox7.Value) + Val(TextBox8.Value) + Val(TextBox9.Value) + Val(TextBox10.Value) + Val(TextBox11.Value) + Val(TextBox12.Value) + Val(TextBox13.Value) + Val(TextBox14.Value) + Val(TextBox15.Value) + Val(TextBox16.Value) + Val(TextBox17.Value) + Val(TextBox18.Value) + Val(TextBox19.Value) + Val(TextBox20.Value) + Val(TextBox21.Value) + Val(TextBox22.Value) + Val(TextBox23.Value) + Val(TextBox24.Value) + Val(TextBox25.Value) + Val(TextBox26.Value) + Val(TextBox27.Value) + Val(TextBox28.Value) + Val(TextBox29.Value) + Val(TextBox30.Value) + Val(TextBox31.Value) + Val(TextBox32.Value) + Val(TextBox33.Value) + Val(TextBox34.Value) + Val(TextBox35.Value) + Val(TextBox36.Value) + Val(TextBox37.Value) + Val(TextBox38.Value) + Val(TextBox39.Value) + Val(TextBox40.Value) + Val(TextBox41.Value) + Val(TextBox42.Value) + Val(TextBox43.Value) + Val(TextBox44.Value) + Val(TextBox45.Value) + Val(TextBox46.Value)
End Sub
If i try to add another value to the list, it goes red and won't work, and i get either a "compile error:syntax error" or "compile errror: Expected:line number or label or statement or end of statement".
Hope you can help me,
Thanks,
Fuzz :confused: