Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ampersand & in Action query (Access 2000)

    Hi there

    I am trying to run the following query in vba
    strsql = "INSERT INTO ClientHist ( ni_number, last_admission_date, last_discharge_date, Location ) values ('WA237839C', #01/05/2005#, #15/06/2005#, 'Victoria & Grenville Houses';"
    docmd.runsql strsql
    However, I keep getting an error. I think the problem is with the location value as it has an ampersand. Is there any way I can get round this problem?

    Any help would be much appreciated.

    Amanda

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Ampersand & in Action query (Access 2000)

    The ampersand isn't the problem. You forgot the closing parenthesis after the values:
    <code>
    ... 'Victoria & Grenville Houses');"</code>

  3. #3
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ampersand & in Action query (Access 2000)

    Hans - thank you - that was driving me mad and you got it in seconds!

    You star

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •