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

J

Jack

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.
 
M

McKirahan

Jack said:
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,",","")
 
J

Jack

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top