By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,491 Members | 858 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,491 IT Pros & Developers. It's quick & easy.

Problem with character ' in openreport link criteria

P: n/a
Hi,
In my code I have the following:

stLinkCriteria = "[nomcli] like '*" & Me![nomcli] & "*' "

DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

If [nomcli] contains character ' then this doesn't work, I guess
msaccess end the statement with the' character contained in [nomcli].
is there any way of solving this?
thanks,
gonzalo

Jul 10 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If there are embedded apostrophes (') then you need to double them up

So
stLinkCriteria = "[nomcli] like '*" & Replace(Me![nomcli], "'",
"''",compare:=vbTextCompare) & "*' "


--

Terry Kreft
<ci************@gmail.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
Hi,
In my code I have the following:

stLinkCriteria = "[nomcli] like '*" & Me![nomcli] & "*' "

DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

If [nomcli] contains character ' then this doesn't work, I guess
msaccess end the statement with the' character contained in [nomcli].
is there any way of solving this?
thanks,
gonzalo

Jul 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.