I have a sql statement where i pass a variable instead of passing the value directly. for ex:

strQuery = ("Select * from tablename" _
& " where [Company Name]= " & "'" + Trim(variablename) + "'")

when I pass ABC as variable value its working fine. But when I pass ABC's as the value it is giving me a error.

any help might help.

thankyou.