By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,369 Members | 1,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,369 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Oct 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:D7**********************************@microsof t.com...
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,",","")

Oct 18 '05 #2

P: n/a
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" <Ja**@discussions.microsoft.com> wrote in message
news:D7**********************************@microsof t.com...
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,",","")

Oct 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.