Need to remove space from negative value
Posted on 2007-10-08
I have a program where a user types in an amount. It works fine, but if they type in a negative value and leave a space in between the negative and the number it blows up. Ex. - 12.94 instead of -12.94.
Is there a way that I can remove, or replace that space. This is my code, and I need it for the txtAmt.text:
txtyear.Text = dtr("phone_year") & ""
txtmonth.Text = dtr("phone_month") & ""
txtEmployee.Text = dtr("Employee") & ""
txtNumber.Text = dtr("PhoneNumber") & ""
txtAccount.Text = dtr("FunctionalAccount") & ""
txtAmt.Text = dtr("phone_amount") & ""
I tried to do it like this:
Dim vAmt = Replace(Trim(txtAmt.Text), "' '", "")
vAmt = dtr("phone_amount") & ""
But I think that the trim removes spaces before and after, not within the text. If anyone could help me out or lead me in the right direction I would really appreciate it. Thank you.