Results 1 to 2 of 2
  1. #1
    jscriptor09 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    60

    Concat a string that already has "&" in it.

    Hi

    I have this logic that is not working for some reason

    str1 = "Apple & Oranges"
    str2 = " Dont mix"
    str3 = str1 & str2

    this gives str3 = "Apple & Oranges Dont mix". I can see it in the watch window.


    Now I do this ...
    strSQL = "INSERT INTO sometable VALUES('" & _
    str3 & "', '" & _
    a string & "', '" & _
    ...
    ....

    Whe I look in sometable, str3 is stored as "Apple & Oranges"



    Any idea why this behavior?

    Many thanks
    Mike

  2. #2
    jscriptor09 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    60
    Never mind, I goofed.

    The table where it was writing to has the text field length st to a certain value (10 for example). I was not aware of it and wasted 2 hours trying to chase an "&" issue.

    Sorry about the post.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-14-2012, 04:47 PM
  2. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  3. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  4. Replies: 16
    Last Post: 07-22-2011, 09:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums