473,409 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

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

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
2 2445
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Arne | last post by:
From: "Arne de Booij" <a_de_booij@hotmail.com> Subject: Comma delimited array into DB problems Date: 9. februar 2004 10:39 Hi, I have an asp page that takes input from a form on the previous...
8
by: Deepa | last post by:
I am writing a console app in c# wherein am converting a dataset into a CSV file. It works fine. But I have some values in the dataset which have a comma within(eg. A,B,C). When I view the CSV file...
8
by: tshad | last post by:
I have a function that formats currency to add commas and $. But I also check to see if the field is empty and if it is I return. The problem is that the field now contains the word...
3
by: James | last post by:
Hi, I have a combo box(cmboParts) and the row source is a part name. Once a part is selected I have button(cmdOrderAdd) to add data about this part to a sub-form(frmParts_Ordered). However this...
3
by: Gary Smith | last post by:
Hi, I've got a field that contains a list of rooms. In most cases, this contains a single ID. However, under some circumstances, the field may contain a list of two IDs which are broken by a...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
4
by: Ryan Moore | last post by:
how do I format a databound field in a datagrid to place a comma for a currency (eg 126,000) I'm currently using: DataBinder.Eval(Container.DataItem, "price", "{0:c}" thanx
7
by: Sick | last post by:
My application populates a ListBox from a .TXT file. In the textfile there are prices with both dots as well as comma's for decimal indication. Example: 1234990; xg-tr-45; 1700,50; 0 2662666;...
4
by: sufian | last post by:
Below is the field where user enters his/her email address and the AJAX post request is sent to the server and the user sees the message: echo("<div id=\"message\" class=\"success\">Thank you! You...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.