Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

cbo Lookup Error

Discussion in 'Information Technology' started by Jeff C, Jul 28, 2006.

Tags:
  1. Jeff C

    Jeff C
    Expand Collapse
    Guest

    What changes do I need to make to the following to allow lookup of office
    names that include apostrophies?

    rs.FindFirst "[Office_Name] = '" & Me![cbo_Office] & "'"


    These kind of syntax errors just drive me NUTS, someday I will understand
    the rules.

    Thank you in advance
    --
    Jeff C
    Live Well .. Be Happy In All You Do
     
  2. OP
    Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    Try:
    rs.FindFirst "[Office_Name] = """ & Me![cbo_Office] & """"

    For an explanation, see:
    Quotation marks within quotes
    at:
    http://allenbrowne.com/casu-17.html

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Jeff C" <JeffC@discussions.microsoft.com> wrote in message
    news:ABE3CD7B-3C43-4E96-B6E1-01EAE862BC2D@microsoft.com...
    > What changes do I need to make to the following to allow lookup of office
    > names that include apostrophies?
    >
    > rs.FindFirst "[Office_Name] = '" & Me![cbo_Office] & "'"
    >
    >
    > These kind of syntax errors just drive me NUTS, someday I will understand
    > the rules.
    >
    > Thank you in advance
    > --
    > Jeff C
    > Live Well .. Be Happy In All You Do
     
  3. OP
    RoyVidar

    RoyVidar
    Expand Collapse
    Guest

    "Jeff C" <JeffC@discussions.microsoft.com> wrote in message
    <ABE3CD7B-3C43-4E96-B6E1-01EAE862BC2D@microsoft.com>:
    > What changes do I need to make to the following to allow lookup of
    > office names that include apostrophies?
    >
    > rs.FindFirst "[Office_Name] = '" & Me![cbo_Office] & "'"
    >
    >
    > These kind of syntax errors just drive me NUTS, someday I will
    > understand the rules.
    >
    > Thank you in advance


    You can do what is often called "doublequoting"

    rs.FindFirst "[Office_Name] = """ & Me![cbo_Office] & """"

    but - when doing lookups like this, don't you have a primary key field
    within the combo you could use?

    --
    Roy-Vidar
     
  4. OP
    Jeff C

    Jeff C
    Expand Collapse
    Guest

    Thanks Allen I printed up your tutorial too.

    Thanks to you too Roy
    --
    Jeff C
    Live Well .. Be Happy In All You Do


    "Allen Browne" wrote:

    > Try:
    > rs.FindFirst "[Office_Name] = """ & Me![cbo_Office] & """"
    >
    > For an explanation, see:
    > Quotation marks within quotes
    > at:
    > http://allenbrowne.com/casu-17.html
    >
    > --
    > Allen Browne - Microsoft MVP. Perth, Western Australia.
    > Tips for Access users - http://allenbrowne.com/tips.html
    > Reply to group, rather than allenbrowne at mvps dot org.
    >
    > "Jeff C" <JeffC@discussions.microsoft.com> wrote in message
    > news:ABE3CD7B-3C43-4E96-B6E1-01EAE862BC2D@microsoft.com...
    > > What changes do I need to make to the following to allow lookup of office
    > > names that include apostrophies?
    > >
    > > rs.FindFirst "[Office_Name] = '" & Me![cbo_Office] & "'"
    > >
    > >
    > > These kind of syntax errors just drive me NUTS, someday I will understand
    > > the rules.
    > >
    > > Thank you in advance
    > > --
    > > Jeff C
    > > Live Well .. Be Happy In All You Do

    >
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page