I am no programer but i am trying to write a program for my tablet pc for my work. Please read this code and tell me how can I stop the "if material" statement executing as it seems to carry on even when the condition is met "end if" just puts up the error i have shown. I realise this may be a long winded way to do it but as i say i am only learning. If anyone can help please do qtytxt1 will i hope eventualy contain sundrie material values eg cement or sand etc. Could i call a seperate sub when a value is met perhaps
If material = "Single Bricks" Then qtyunround = (sumtotm2 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.Text &" "& material
qtytxt1.text= "bricks"
If material = "Single Blocks" Then qtyunround = (sumtotm2 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
qtytxt1.text= "blocks"
If material = "Single Paving Blocks" Then qtyunround = (sumtotm2 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Single Flags 900x600" Then qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Single Flags 750x600" Then qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Single Flags 600x600" Then qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Single Flags 450x450" Then qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Single Flags 400x400" Then qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Single Flags 300x300" Then qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Single Plasterbord 2400x1200" Then qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Single Plasterbord 1800x900" Then qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Single Plasterbord 2400x900" Then qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Single Plasterbord 1220x900" Then qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "None m2 only" Then qtytxt.Text = ""
'Convert m3 to tonnes for appropriate materials
If material = "m3 Concrete" Then qtyunround = (sumtotm3)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Tonnes Sand" Then qtyunround = (sumtotm3 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Tonnes Soil" Then qtyunround = (sumtotm3 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Tonnes Tarmac" Then qtyunround = (sumtotm3 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
If material = "Tonnes MotType1" Then qtyunround = (sumtotm3 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material