Hi,
I'm making a program in VB with a SQL SERVER database.
In my database I have two fields that they are numerical, Montante_PTE and Montante_EUR (this field is numerical with scale 2).
In my code I have 2 functions that they convert the values to Euros or PTE (portuguese money) and places the values in the respective text boxes. This is the code of the functions:
-----------------------------------------------------------
Function Converte_EUR(valor As String)
If IsNumeric(valor) And txtPTE <> Format(txtPTE, "###0.00" Then
txtEUR = Format((txtPTE / 200.482), "###0.00"
txtEUR.Locked = True
End If
End Function
Function Converte_PTE(valor As String)
If IsNumeric(valor) Then
txtPTE = Format((txtEUR * 200.482), "###0"
txtPTE.Locked = True
End If
End Function
-----------------------------------------------------------
When I make the Update in the database(adoDespesasRs.UpdateBatch adAffectAll), the program generates an error: error number -2147217887 (80040e21) Multiple-step operation generated errors. Check each states value).
If the user write the values in the text boxes, the program wok fine.
Which is the problem with this code?
Thanks for any tip.
I'm making a program in VB with a SQL SERVER database.
In my database I have two fields that they are numerical, Montante_PTE and Montante_EUR (this field is numerical with scale 2).
In my code I have 2 functions that they convert the values to Euros or PTE (portuguese money) and places the values in the respective text boxes. This is the code of the functions:
-----------------------------------------------------------
Function Converte_EUR(valor As String)
If IsNumeric(valor) And txtPTE <> Format(txtPTE, "###0.00" Then
txtEUR = Format((txtPTE / 200.482), "###0.00"
txtEUR.Locked = True
End If
End Function
Function Converte_PTE(valor As String)
If IsNumeric(valor) Then
txtPTE = Format((txtEUR * 200.482), "###0"
txtPTE.Locked = True
End If
End Function
-----------------------------------------------------------
When I make the Update in the database(adoDespesasRs.UpdateBatch adAffectAll), the program generates an error: error number -2147217887 (80040e21) Multiple-step operation generated errors. Check each states value).
If the user write the values in the text boxes, the program wok fine.
Which is the problem with this code?
Thanks for any tip.