I need to pass a number from a TexBox with this format 1,2 to a sql string in this format 1.2
My locale is It-it and uses decimal point with a comma (1,2).
How can I do this change in VBA? I wrote this code...
Thanks, PaoloCode:Private Sub insert_article_Click() 'set decimal separator as point With Application .DecimalSeparator = "." .ThousandsSeparator = "," .UseSystemSeparators = False End With Dim number As Double Dim word As String word = "test" number = CDbl(Textnumber.Value) 'if I enter 1,2 ,number will be 1,2 'I try also this, but number will be 1,2 'number = Replace(Textnumber.Value, ".", ",") strSQL = "INSERT INTO table (col_word, col_number) VALUES ('" & word & "'," & number & ")" ... End Sub




Reply With Quote
