Results 1 to 4 of 4
  1. #1
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78

    Insert into when field has a slash "/"

    Hello, this is my sql in vba code



    db.Execute "Update tblEOS Set tblEOS.[SCOPECAT] = " & Me.cboBusinessUnit & ">" & Me.cboWorkType & ">" & Me.SCOPECAT & _
    " where ttblEOS.[RequestID] = " & Me.RequestID, dbFailOnError


    but the value has a slash and I'm getting an error. how can I get around this?


  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    what has the value w slash?

    "Update tblEOS Set tblEOS.[SCOPECAT] =' " & Me.cboBusinessUnit & ">" & Me.cboWorkType & ">" & Me.SCOPECAT & " ' where ttblEOS.[RequestID] = " & Me.RequestID

    SOPECAT is text so it should allow the slash, but it did need 'string delimiters'
    Me.RequestID CANNOT have a slash, it must be numeric.

  3. #3
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78
    Thank you for your input, I realize that I was inserting the wrong id value into RequestID and it wasn't finding it. That was the error.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Should probably save these elements to separate fields instead of concatenated into one. Why save with ">" character?

    You may have corrected RequestID input but the SQL should still fail.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 11-14-2019, 11:30 AM
  2. Forward slash "/" showing up in count total
    By UAVPilotMRG in forum Reports
    Replies: 4
    Last Post: 09-27-2019, 08:39 PM
  3. Replies: 3
    Last Post: 09-21-2017, 05:40 AM
  4. Replies: 8
    Last Post: 11-25-2013, 03:35 PM
  5. Replies: 3
    Last Post: 04-22-2013, 06:08 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