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

Discussion in 'ASP General' started by Jack, Oct 18, 2005.

  1. Jack

    Jack Guest

    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.
     
    Jack, Oct 18, 2005
    #1
    1. Advertising

  2. Jack

    McKirahan Guest

    "Jack" <> wrote in message
    news:D...
    > 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,",","")
     
    McKirahan, Oct 18, 2005
    #2
    1. Advertising

  3. Jack

    Jack Guest

    Re: Hanlding comma in a field in a form which takes currency value

    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" <> wrote in message
    > news:D...
    > > 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,",","")
    >
    >
    >
    >
     
    Jack, Oct 18, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Dixson
    Replies:
    1
    Views:
    547
    Joe Fallon
    May 18, 2004
  2. Richard Dixson
    Replies:
    2
    Views:
    761
    Richard Dixson
    May 18, 2004
  3. NotGiven
    Replies:
    3
    Views:
    389
    Michael D. Kersey
    May 13, 2004
  4. GavMc
    Replies:
    4
    Views:
    385
    Evertjan.
    Sep 22, 2005
  5. NotGiven
    Replies:
    3
    Views:
    333
    Michael D. Kersey
    May 13, 2004
Loading...

Share This Page