Welcome to SPN

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

Sign Up Now!

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. 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. 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. 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

    >
    >
    >
     

Share This Page