473,490 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

rs.FindFirst question

Is there a way to use this when entries have an apostrphe in them?

Like Joe's Bar and Grill.
Nov 13 '05 #1
6 5943
On Wed, 26 Oct 2005 00:02:06 -0400, Shyguy <sh****@aol.com> wrote:

Yes: double-up on them:
rs.FindFirst "LastName='O''Brien"

-Tom.

Is there a way to use this when entries have an apostrphe in them?

Like Joe's Bar and Grill.


Nov 13 '05 #2
I think your answer is correct.

Nov 13 '05 #3
On Tue, 25 Oct 2005 21:21:06 -0700, Tom van Stiphout
<no*************@cox.net> wrote:
On Wed, 26 Oct 2005 00:02:06 -0400, Shyguy <sh****@aol.com> wrote:

Yes: double-up on them:
rs.FindFirst "LastName='O''Brien"

-Tom.

Is there a way to use this when entries have an apostrphe in them?

Like Joe's Bar and Grill.

Thank you for the reply.

I guess there are other ways to use "rs.FindFirst" . ;-( I am using it
behind a combo box and the full line is -

rs.FindFirst "[Organization] = '" & Me![cboOrg] & "'"

Some of the names hgave an apostrophe but some don't. The ones that
don't work fine. When one is selected that has an apostrophe I get a
runtime error 3077 and syntax error (missing operator) in expression.
Nov 13 '05 #4
Shyguy wrote:
I guess there are other ways to use "rs.FindFirst" . ;-( I am using it
behind a combo box and the full line is -

rs.FindFirst "[Organization] = '" & Me![cboOrg] & "'"


Don't mean to jump in on Tom, but don't use the single quotes where
you're using them now. Do this:

rs.FindFirst "[Organization] = """ & Me![cboOrg]) & """"

Or, as doubling up on double quotes can get hard to keep track of for
long strings (the chr(34) is a ":

rs.FindFirst "[Organization] = " & chr(34) & Me![cboOrg]) & chr(34)

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #5
On Wed, 26 Oct 2005 14:56:41 -0230, Tim Marshall
<TI****@PurplePandaChasers.Moertherium> wrote:
Shyguy wrote:
I guess there are other ways to use "rs.FindFirst" . ;-( I am using it
behind a combo box and the full line is -

rs.FindFirst "[Organization] = '" & Me![cboOrg] & "'"


Don't mean to jump in on Tom, but don't use the single quotes where
you're using them now. Do this:

rs.FindFirst "[Organization] = """ & Me![cboOrg]) & """"

Or, as doubling up on double quotes can get hard to keep track of for
long strings (the chr(34) is a ":

rs.FindFirst "[Organization] = " & chr(34) & Me![cboOrg]) & chr(34)

Thank you very much. It worked fine, after I removed the extra )
;-)
Nov 13 '05 #6
Shyguy wrote:

Thank you very much. It worked fine, after I removed the extra )
;-)


Until you get one with a double quote in it, say the organisation is the
over 6'5" club :-)

Try:
rs.FindFirst "[Organization] = '" & Replace(Me![cboOrg]"'","''") & "'"
Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
33333
by: Paul | last post by:
The 2 statements below work perfectly when using them individually. But when I try to concatenate them, they don't. rst.FindFirst " = " & OldQuoteNumber rst.FindFirst " Is Null" Can someone...
1
9059
by: cnlai | last post by:
Snippets -------- Dim mydb As Database, myset As DAO.Recordset Set mydb = CurrentDb Set myset = mydb.OpenRecordset("abc") myset.FindFirst (" = 'S02'") '<< problem here Reference: MS DAO...
1
1642
by: Shaun | last post by:
Hi all Simple question re .findfirst Is it true it does not use any indexes and really the best option with a SQl backend (ignoring using Stored Procedures which at this stage has not been...
5
5832
by: MLH | last post by:
I have a table I can open as table type recordset or a dynaset. Searching for a particular value in the table's main keyfield, which would be faster and less strain on the application......
2
2431
by: keri | last post by:
Hi everyone, I'm using findfirst in code as below. It searches a query that shows appointment date and account name and should return the account name of the first appointment on each day into...
7
19581
by: waltvw | last post by:
I'm using FindFirst method in Access VBA to find a particular record in a recordset. I have 2 search criteria each of which works just fine if used separately as an argument in FindFirst, but NOT in...
3
3251
by: boliches | last post by:
I am trying to get a continuous form to highlight lines individually (ideally on hover). I have used the following code as recommended by a previous entry on this website. My problems begin in that...
2
3626
by: Denise | last post by:
Front end is Access 2002, back end is linked Oracle tables. My users need to describe things in feet and inches and want to use the standard ' and " abbrevations. On a testing form I go to a...
25
3886
by: Rick Collard | last post by:
Using DAO 3.6 on an Access 2002 database, I'm getting unexpected results with the FindFirst method. Here's the simple code to test: Public Sub FindIt() Dim db As Database, rs As Recordset...
0
7112
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
6974
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
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7183
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...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.