Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Hanlding comma in a field in a form which takes currency values

Reply
Thread Tools

Hanlding comma in a field in a form which takes currency values

 
 
Jack
Guest
Posts: n/a
 
      10-18-2005
Hi,
I have form where one has to input officer's salary along with other data.
The officer's salary field is tied to a currency field in backend Access.
Right now folks enter numbers e.g. 30000.00. However, when someone is writing
30,000.00
a error message comes which shows syntax error. The sql statement via
response.write does not allow me to update the database. However, without the
comma, things are fine. Is there any way to create a error message, which
will not allow one to save the record, if comma is put in the salary value
e.g. 40,000.00?
Any help is appreciated. Thanks.
 
Reply With Quote
 
 
 
 
McKirahan
Guest
Posts: n/a
 
      10-18-2005
"Jack" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> Hi,
> I have form where one has to input officer's salary along with other data.
> The officer's salary field is tied to a currency field in backend Access.
> Right now folks enter numbers e.g. 30000.00. However, when someone is

writing
> 30,000.00
> a error message comes which shows syntax error. The sql statement via
> response.write does not allow me to update the database. However, without

the
> comma, things are fine. Is there any way to create a error message, which
> will not allow one to save the record, if comma is put in the salary value
> e.g. 40,000.00?
> Any help is appreciated. Thanks.


Can you allow the commas, which is more convenient for users, then
strip it out before updating the database table? For example,
strAMT = Replace(strAMT,",","")



 
Reply With Quote
 
 
 
 
Jack
Guest
Posts: n/a
 
      10-18-2005
Thanks McKirahan for your help. It does work fine now by introducing the
replace statement. With this I can avoid generating error statement as
before. Best regards.

"McKirahan" wrote:

> "Jack" <(E-Mail Removed)> wrote in message
> news(E-Mail Removed)...
> > Hi,
> > I have form where one has to input officer's salary along with other data.
> > The officer's salary field is tied to a currency field in backend Access.
> > Right now folks enter numbers e.g. 30000.00. However, when someone is

> writing
> > 30,000.00
> > a error message comes which shows syntax error. The sql statement via
> > response.write does not allow me to update the database. However, without

> the
> > comma, things are fine. Is there any way to create a error message, which
> > will not allow one to save the record, if comma is put in the salary value
> > e.g. 40,000.00?
> > Any help is appreciated. Thanks.

>
> Can you allow the commas, which is more convenient for users, then
> strip it out before updating the database table? For example,
> strAMT = Replace(strAMT,",","")
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pass hidden form field value to another form field to insert in db GavMc ASP General 4 09-22-2005 06:33 PM
Can you persist table cell values like you do with form field values? Richard Dixson ASP .Net 2 05-18-2004 01:11 PM
Can you persist table cell values like you can do with form field values? Richard Dixson ASP .Net 1 05-18-2004 03:47 AM
copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome? NotGiven Javascript 3 05-13-2004 12:15 AM
copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome? NotGiven ASP General 3 05-13-2004 12:15 AM



Advertisments