Thanks,
Chris
I'm attaching a file, "fncReplaceText.bas" that defines a string-replacement
function. Make a backup copy of your database before proceeding. Now
paste this function into a standard module, so that it is available
throughout your database.
Now create an update query with SQL along these lines:
UPDATE tblMyTable SET MyField = fncReplaceText([MyField ],"'","""")
WHERE (InStr([MyField ],"'")>0);
Execute this query, and it will change all single quotes in MyField to
double quotes. If you save the query, you can execute it whenever you need
to, programmatically. You can create a variety of similar queries to fix up
whatever common data entry problems you have.
--
Dirk Goldgar
(remove NOSPAM from reply address)
"Chris Savedge" <chr...@legendvalve.com> wrote in message
news:OwFzroo...@cppssbbsa02.microsoft.com...
--
Dirk Goldgar
(to reply via email, remove NOSPAM from address)
Dirk Goldgar wrote in message ...
>I'm attaching a file, "fncReplaceText.bas" that defines a string-replacement
>function.
Please don't attach a file. Instead include the code inside a
message. Fortunately you didn't include the entire MDB in which case
you'd be getting a lot of blasts. <smile>
Tony
----
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
VolStar http://www.volstar.com Manage hundreds or
thousands of volunteers for special events.
Could you explain to me why including the text of the function in the
message should be preferable to attaching a text file? I'm hoping to with
avoid the confusion caused by line wrapping done by the mailreader.
--
Dirk Goldgar
(to reply via email, remove NOSPAM from address)
Tony Toews wrote in message <54h7ssoecdbflg06m...@4ax.com>...
>Could you explain to me why including the text of the function in the
>message should be preferable to attaching a text file? I'm hoping to with
>avoid the confusion caused by line wrapping done by the mailreader.
Ah, gotcha. Actually your attached file was quite small so putting it
in the newsgroup would be just fine.
It's just that some folks put entire 1 Mb MDBs in a newsgroup. Many
folks who follow the newsgroups don't have the cheap Internet access
we have in Canada and the U.S. Most countries still charge by the
minute even for local calls.
One idiot student once emailed me an 3 MB MDB for me to review and do
his homework.
1) He never asked me.
2) Much of that 3 Mb was in a very colourful and totally inappropriate
background image on his menu which also meant you could'nt even see
the menu items.
3) More of that 3 Mb would've been cleaned up with compacting
4) He never even bothered to zip or otherwise compress it.
5) I was on a modem at the time which made things much, much worse.
>One idiot student once emailed me an 3 MB MDB for me to review and do
>his homework.
>1) He never asked me.
>2) Much of that 3 Mb was in a very colourful and totally inappropriate
>background image on his menu which also meant you could'nt even see
>the menu items.
You opened it Tony?
Joan
Yes, I know; I was once in the same boat, paying for my internet connection
by the byte transferred. Even now, I have a relatively slow dial-up
connection, so I try to be scrupulous about the sizes of my posts.
>You opened it Tony?
Well he had me quite curious by now.
Tony (a curious cat is a dead cat)