table addRow problem

Luiji

Member
Licensed User
please help
I have a table whith 4 colums, the first is sting the other numbers
Code:

Sub Button4_Click
Form1.Show
table1.AddCol(cString,"Item",85)
table1.AddCol(cNumber,"Quant.",40)
table1.AddCol(cNumber,"P.Unit.",50)
table1.AddCol(cNumber,"P.Parc.",50)
End Sub

Sub btnGravar_Click
Nome=tbNome.text ' item
Quantidade=tbQuantidade.Text 'Quant.
PrecoUnidade=tbPrecoUnidade.Text 'P.Unit.
precoParcial=tbQuantidade.Text*tbPrecoUnidade.Text 'P.Parc.
table1.AddRow(Nome,Quantidade,PrecoUnidade,precoParcial)
End Sub

it works fine on Run mode in IDE, but dont work compiled to Pc or to PPC
error:
An error ocurred on sub_btngravar_click
Input string was not in correct format
 

Rallig

Member
Licensed User
Longtime User
Perhaps it is not the solution of this problem but I see a space in:

table1.AddRow(Nome,Quantidade,PrecoUnidade,precoPa rcial)


Greeting
Rallig
 

Luiji

Member
Licensed User
hi!!
the space is a copy paste error :)

correction:
Sub Button4_Click
Form1.Show
table1.AddCol(cString,"Item",85)
table1.AddCol(cNumber,"Quant.",40)
table1.AddCol(cNumber,"P.Unit.",50)
table1.AddCol(cNumber,"P.Parc.",50)
End Sub

Sub btnGravar_Click
Nome=tbNome.text ' item
Quantidade=tbQuantidade.Text 'Quant.
PrecoUnidade=tbPrecoUnidade.Text 'P.Unit.
precoParcial=tbQuantidade.Text*tbPrecoUnidade.Text 'P.Parc.
table1.AddRow(Nome,Quantidade,PrecoUnidade,precoParcial)
End Sub
 

Luiji

Member
Licensed User
:(((
i corected the text, but the space apears again
???

table1.AddRow(Nome,Quantidade,PrecoUnidade,precoParcial)
 

Luiji

Member
Licensed User
space again

?????

table1.AddRow(Nome,Quantidade,PrecoUnidade,precoParcial)



i insert in the text box data in correct format
 

agraham

Expert
Licensed User
Longtime User
The problem is with "lblTotal.Text". It is blank by default which the optimising compiler cannot convert to a number and so errors. Set the text to "0" and it works.

You didn't show this line in your code snippet "precototal=lblTotal.Text+precoParcial" :confused:
 
Top