Connecting Tech Pros Worldwide Help | Site Map

rs.FindFirst question

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 02:57 PM
Shyguy
Guest
 
Posts: n/a
Default rs.FindFirst question

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

Like Joe's Bar and Grill.

  #2  
Old November 13th, 2005, 02:57 PM
Tom van Stiphout
Guest
 
Posts: n/a
Default Re: rs.FindFirst question

On Wed, 26 Oct 2005 00:02:06 -0400, Shyguy <shyguy@aol.com> wrote:

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

-Tom.

[color=blue]
>Is there a way to use this when entries have an apostrphe in them?
>
>Like Joe's Bar and Grill.[/color]

  #3  
Old November 13th, 2005, 02:57 PM
lylefair
Guest
 
Posts: n/a
Default Re: rs.FindFirst question

I think your answer is correct.

  #4  
Old November 13th, 2005, 02:57 PM
Shyguy
Guest
 
Posts: n/a
Default Re: rs.FindFirst question

On Tue, 25 Oct 2005 21:21:06 -0700, Tom van Stiphout
<no.spam.tom7744@cox.net> wrote:
[color=blue]
>On Wed, 26 Oct 2005 00:02:06 -0400, Shyguy <shyguy@aol.com> wrote:
>
>Yes: double-up on them:
>rs.FindFirst "LastName='O''Brien"
>
>-Tom.
>
>[color=green]
>>Is there a way to use this when entries have an apostrphe in them?
>>
>>Like Joe's Bar and Grill.[/color][/color]


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.
  #5  
Old November 13th, 2005, 02:57 PM
Tim Marshall
Guest
 
Posts: n/a
Default Re: rs.FindFirst question

Shyguy wrote:
[color=blue]
> 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] & "'"[/color]

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
  #6  
Old November 13th, 2005, 02:57 PM
Shyguy
Guest
 
Posts: n/a
Default Re: rs.FindFirst question

On Wed, 26 Oct 2005 14:56:41 -0230, Tim Marshall
<TIMMY!@PurplePandaChasers.Moertherium> wrote:
[color=blue]
>Shyguy wrote:
>[color=green]
>> 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] & "'"[/color]
>
>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)[/color]


Thank you very much. It worked fine, after I removed the extra )
;-)
  #7  
Old November 13th, 2005, 02:58 PM
Trevor Best
Guest
 
Posts: n/a
Default Re: rs.FindFirst question

Shyguy wrote:[color=blue]
>
> Thank you very much. It worked fine, after I removed the extra )
> ;-)[/color]

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]"'","''") & "'"
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.