formatting date to string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to change a formatted telephone number on the form to an
unformatted string so as to INSERT INTO a table. The following is what is
hanging me up. The info inserts as it should but but on the table I show for
the telephone the # symbol.

txtCustomerTelephone.Text = CStr(txtCustomerTelephone.Text)
txtCustomerTelephone.Text = Format(txtCustomerTelephone.Text, "##########")

What am I doing wrong on this?
Thanks to anyone who responds.
*** John
 
What is the format of the string in the TextBox? If it is has spaces or
non-numeric characters then your format command will not work since VB.NET
will not be able to cast the string to a number. The format string you are
passing is for a number. If the TextBox does not contain a number (ie it
has spaces or dashes, etc) then you will have to parse the string to get the
number out.

Robby
 
Back
Top