Results 1 to 4 of 4

Thread: Error 3075

  1. #1
    Join Date
    May 2011
    Posts
    47

    Unanswered: Error 3075

    Would appreciate help with this... I'm using variable names for fields in my sql and I am getting an error message #3075 and con't figure out why.

    db.Execute "INSERT INTO MyTable_1 (field_1, field_2, field_3, field_4, field_5, field_6, field_7) SELECT field_1, field_2, field_3, field_4, field_5, " & Me.field_with_variable_name_1 & ", " & Me.field_with variable_name_2 & " FROM MyTable_2 WHERE " & field_with_variable_name & " " & math_operator_with_variable_name & " " & field_with variable_name_2 & " AND " & field_with_variable_name & " " & math_operator_with_variable_name & " " & field_with variable_name_2 & ""

    I believe the problem in somewhere in the quotes and/or the ampersands.

    Please help,
    Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Depending on the definition of the columns in the table, you could need to add quotes around some values extracted from the controls if you're dealing with Text data types:
    Code:
    ... & ", '" & Me.field_with variable_name_2 & "' FROM MyTable_2 WHERE " & field_with_variable_name & " " & math_operator_with_variable_name & " '" & field_with variable_name_2 & "' AND " ...
    Have a nice day!

  3. #3
    Join Date
    May 2011
    Posts
    47

    Error 3075

    That did it... Many thanks.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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