[AccessD] Text problem in runSQL SOLVED

Annie Courchesne, CMA accma at sympatico.ca
Fri Apr 17 05:46:49 CDT 2009


It works!

Thanks you all for your help!


Annie


-----Message d'origine-----
De : accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] De la part de Annie
Courchesne, CMA
Envoyé : 16 avril 2009 23:03
À : Accessd
Objet : [AccessD] Text problem in runSQL

Hi everyone,

 

I'm having a problem with a function that a customer wants.  It's for making
quotation.  I have a subform that has the lines of the quote.  On another
subform, I have a list of words.  When I double click on the word, it adds
it wherever the pointer was in the lines of the quotes.  So far, no problem
with that.  

 

Now here's the problem : If the text has a ' in it (exemple : Stone wall of
20' x 10'),  I try to run add "White" in front of the text, it does not
work.  Here the code I use :

 

 

Dim txt as string

 

Txt=me.word & " " & me.description

 

SQL = "UPDATE tblSoumissionDetail SET tblSoumissionDetail.Description = '" &
txt & "' WHERE (((tblSoumissionDetail.SoumDetailID)=" & Me.Parent.LigneID &
"));"

DoCmd.RunSQL SQL

 

 

 

Me.word : White

Me.description : Stone wall of 20' x 10'

 

In an exemple as this one, I get a runtime error 3075.  I know it's because
of the ' . but I have no idea how to solve this!

 

Anyone can help?

 

Thanks!

 

 

Annie

 

 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list