Trouble with the decimal point

pilotgabriel used Ask the Experts™
Hello, I need same help about the input in a text box control. But first let me explain that I'm in Buenos Aires, Argentina, and here the style to handle numeric values is to use the comma "," as decimal point, and the dot "." as  miles separator. Then I can continue: I have a table of SQL in a form, and when I edit one of the numeric fields with decimal places, it shows ok as I told before, but when I edit one of them, they lose the decimal point ","...but the strange thing is that in the SQL, I can see and edit correctly the same table, so I conclude the problem is with the VB. Oh, I forgot to tell something, I verified at control panel the regional configuration and it's ok, so what could be the problem ?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Well, I'm exactly sure what could be causing it.  There is a format property of a text box, and I suppose that VB could have automatically set it as numeric.  If not, you could fix this by putting the following in the Validate Event of the text box.

MyTextBox.Text = Replace(MyTextBox.Text, ".", ",")

Where "MyTextBox" is the name of your text box.

You might even try the FormatNumber() function.  I'm not sure if that follows the regional settings on your computer though.

Quesiton:  If the "." are replace by "," then, what does "4,200.554" look like?  Does it look like "4,200,554"?


Answer to that question:  If the "." are replace by "," then, what does "4,200.554" look like?  Does it look like "4,200,554"?

Answer : the number "4,200.554" looks like that : 4.200,554
We get used to handle the numbers with that format.

And by the main question, I tested the replace command, by didn't make the right efect. The same thing witrh the FormatNumber function, because it doesn't has any option to handle decimal point, in fact the help says that the function brings that from regional settings.

Oh, and the first thing you said, the posibility of using the format property, I read the manual of VB and it says that we have to use the stdDataFormat library. Of course I tested too, without success...but, don't worry if you can't find another answer, because I'm thinking after all in changing the way to handle numbers as like yourself, in US format...anyway, I apreciate your help and your time, then I give you the points as the right answer, ok ? good bye and have I nice 2003 ! :-)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial