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 / Database Design / July 2005

Tip: Looking for answers? Try searching our database.

Trouble inputting Aposrophe.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pompeyjim - 31 Jul 2005 11:45 GMT
I have a main form for customer head office details with CustID, CustName,
CustAddress etc which has a subform for invoice addesses. There is also a
command button which will take you to another form which is for delivery
addresses. Now some customers have an apostrophe in their company names but
if I put the apostrophe in the text box containing the company name, say
“Acme’s” for instance, and then click the delivery address command button I
get an error message saying “Syntax error in string in query expression
’[CompanyName]=’Acme’s”. I can put any other puctuation in and it opens the
delivery address form no problem. What am I doing wrong and is there any way
to cure it?
Allen Browne - 31 Jul 2005 12:37 GMT
Use the double-quote instead of the single quote to delimit the value, i.e.:
   "[CompanyName=""Acme's"""

The doubled-up double quotes are needed to tell VBA this is an embedded
quote, not the end of the string.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a main form for customer head office details with CustID, CustName,
> CustAddress etc which has a subform for invoice addesses. There is also a
[quoted text clipped - 10 lines]
> way
> to cure it?
 
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.