Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / April 2006

Tip: Looking for answers? Try searching our database.

Escape charcter for '

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karen Hill - 16 Apr 2006 19:58 GMT
When a user types ' in a Memo control, It throws an error message on a
DoCmd.RunSQL.  What is the escape character for ' which I can insert
before ' so it won't throw an error message?  Any other ideas on
dealing with this?

Thanks
RoyVidar - 16 Apr 2006 20:08 GMT
Karen Hill wrote in message
<1145213892.214941.22700@e56g2000cwe.googlegroups.com> :
> When a user types ' in a Memo control, It throws an error message on
> a DoCmd.RunSQL.  What is the escape character for ' which I can
> insert before ' so it won't throw an error message?  Any other ideas
> on dealing with this?
>
> Thanks

Double it up.

...set mymemo = '" & replace(me!txtMyMemo.value, "'", "''") & "' ...

Signature

Roy-Vidar

David W. Fenton - 16 Apr 2006 20:33 GMT
> When a user types ' in a Memo control, It throws an error message
> on a DoCmd.RunSQL.  What is the escape character for ' which I can
> insert before ' so it won't throw an error message?  Any other
> ideas on dealing with this?

If you put double quotes around the string values in your SQL, it
should run without an error.

If you have mixed ' and " in the field, then use " around the
literal value and parse the " in the field to Chr(34).

You can find the ASCII code with Asc("'"), and refer to it as
Chr(###).

Signature

David W. Fenton                  http://www.dfenton.com/
usenet at dfenton dot com    http://www.dfenton.com/DFA/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.