473,385 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problem with character ' in openreport link criteria

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
1 1391
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Aaron | last post by:
Hello, I'm trying to limit a report to a list of parameters that I pass in. The report and the underlying query both use the column FirstName. Whenever I try to limit the FirstName in via the...
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
2
by: John M | last post by:
I want to select records which meet different criteria. I have a combo box which takes the dates from the table containing the records. I select the date from the menu, then open the form which...
1
by: kkrizl | last post by:
I have a form that displays general information about an alarm permit location. There's a subform that shows detailed information about burglar alarms that have gone off at the location. When a...
8
by: sara | last post by:
I have a report that runs fine with data. If there is no data, I have its NO Data event sending a MsgBox and cancelling the report. Then it seems I still get the 2501 message on the Open Report...
7
by: fleece | last post by:
I set up a form for searching criteria and pass the searching result to a report. On this report there is an unbound text box (=.Filter) and shows the searching criteria. It works fine when searching...
2
by: Ceebaby via AccessMonster.com | last post by:
Hi Folks I wondered if someone could point me in the right direction before I completely tear my hair out. I have a user selection form where options can be selected for a report. Users now...
1
by: MLH | last post by:
Stephen Lebans has a function named ConvertReportToPDF that I use from time to time. It's quite handy, actually. In that FN is a line that reads as follows: DoCmd.OutputTo acOutputReport,...
24
by: g diddy | last post by:
I have a similar problem and I have been following the advice but to no avail. I am a novice with VBA so help would be greatly appreciated. This is my first post so I apologise if it is in the wrong...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.