Results 1 to 4 of 4

Thread: SQL code error

  1. #1
    Join Date
    Jan 2014
    Posts
    29

    Unanswered: SQL code error

    I have used this code else where in my app. but iam now getting the following error in this instance.

    run time error: 3075 syntax error in string in query expression
    Can anyone please assist.

    Cheers Andy

    images attached
    Attached Thumbnails Attached Thumbnails Nominal error1.png   nominal error2.png  

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    look again at your SQL
    ..there is no closing ' delimiter on MySupp

    Im suspicious of the AssNom value being delimited by ', if its a numerioc value going into a numeric column then there is no need to delimit
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jan 2014
    Posts
    29
    yes, Assnom and MyNom are both numeric

    i have had this code working in another instance with no issues. Odd

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Access VBA is fairly forgiving, its quite good at interpreting what you meant to say a
    as opposed to what your do say. However if you don't have a matching closing delimiter it will throw a wobbler

    the code may well have run where you copied it from, but the probnlem is you didn't copy the whole thing.

    FYI
    numeric values should NOT be delimited
    alphanumeric values should be delimited with either ' or ", although ' is preferred as its the ISO SQL route
    dates should be delimited with # AND be in either ISO (yyyy/mm/dd) or US format (mm/dd/yyyy)
    eg:-
    Code:
    UPDATE mytable set mynumericcolumn = 12345.67,  mytextcolumn = 'a1234', mydatecolumn = #2014/03/13#
    Code:
    strSQL = "UPDATE mytable set mynumericcolumn = 12345.67,  mytextcolumn = 'a1234', mydatecolumn = #2014/03/13#"
    Code:
    strSQL = 'UPDATE mytable set mynumericcolumn = 12345.67,  mytextcolumn = "a1234", mydatecolumn = #2014/03/13#'
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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