Apostraphe Problem

R

rico

Hi All,

I'm having problems when my users enter data with an apostraphe, i use a lot
of un bound forms so input alot of data using code. When a user inputs for
example "David O'Keith" they get an error, when the form attempts to save the
record.

So far i have only found functions to strip the apostraphe, this is not
preferable.

Any ideas.

TIA

Rico
 
R

Rick B

What is the error?

What type of field is this being saved in?

Is there any code running that might affect this?
 
C

ChrisHulan

Hi All,

I'm having problems when my users enter data with an apostraphe, i use a lot
of un bound forms so input alot of data using code. When a user inputs for
example "David O'Keith" they get an error, when the form attempts to save the
record.

So far i have only found functions to strip the apostraphe, this is not
preferable.

Any ideas.

TIA

Rico

You need to check the user's input for apostrophes, and replace each
single with two apostrophes:
Input: "David O'Keith"
Escaped apostrophe: "David O''Keith"

Thats two apostrophes between O and K, not a double-quote

Cheers
 
R

Rick B

Why would you need to do that? I just went into one of my databases and
entered a name with an apostrophe and it worked just fine. I think the
submitter is saying that the users are simply entering a record from a form
and they are getting an error if the entry contains an apostrophe.
 
C

ChrisHulan

Why would you need to do that? I just went into one of my databases and
entered a name with an apostrophe and it worked just fine. I think the
submitter is saying that the users are simply entering a record from a form
and they are getting an error if the entry contains an apostrophe.

The OP mentioned the forms are unbound so I am guessing he is
manipulating the data somehow and then updating his DB
If he is building the insert DML and the quotes are not properly
escaped he will get errors

Cheers
 
R

Rick B

ahhhh. Good point.

:)


--
Rick B



ChrisHulan said:
The OP mentioned the forms are unbound so I am guessing he is
manipulating the data somehow and then updating his DB
If he is building the insert DML and the quotes are not properly
escaped he will get errors

Cheers
 
Top