Hello,
indeed, you are right ... it works fine on a testcase but not in my application it isn't. Very strange???
I am working with an adp project and I want to fill a table. Before I run the SQL I want to make sure that the layout of the number is correct. I mean use a dot and not more than 2 decimals.
the code:
Private Sub txtwaarde_AfterUpdate()
Me.txtwaarde = Round(Me.txtwaarde, 2)
Me.txtwaarde = Replace(Me.txtwaarde, ",", ".")
End Sub
After that there is a button to save the value with this SQL:
strSQL = " INSERT INTO"
strSQL = strSQL & " TblKwaliteitswaarde ( Moederrolnummer, Kwaliteitswaarde, KwaliteitID )"
strSQL = strSQL & " VALUES(" & [Forms]![FrmIngaveparametersfrq]![Txtmoederrolnr] & ","
strSQL = strSQL & "" & [Forms]![FrmIngaveparametersfrq]![txtwaarde] & "," & [Forms]![FrmIngaveparametersfrq]![txtkwaliteitID] & ")"
CurrentProject.connection.Execute (strSQL)
When I show a msgbox of the SQL the dot is missing and suddenly 12.4412 becomes 124412
When I remove the round function everything works fine.
I haven't got any idea what is wrong?
Best regards,
Sven.