Enter a variable input in a query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shootah
    New Member
    • Dec 2006
    • 3

    Enter a variable input in a query

    Hi,

    I've managed to create this query
    Code:
    test = "Select * FROM table Where fieldvalue = " & value & " ORDER By
    This code works just fine if the value returned is a number (for instance 3)

    When it returns a text, it gives me the error message 3075 "Syntax error (missing operator) in query expression 'Fieldvalue = value x' " where x is the value chosen in a combobox

    Is this a cummon problem?

    I'm trying to transport data from an Access datatable towards Excel...
  • Shootah
    New Member
    • Dec 2006
    • 3

    #2
    Found the solution: Needed to put ' " & Value & " ' because it needs 'value' and not just value

    Comment

    • sashi
      Recognized Expert Top Contributor
      • Jun 2006
      • 1749

      #3
      Originally posted by Shootah
      Found the solution: Needed to put ' " & Value & " ' because it needs 'value' and not just value
      Hi there,

      Congrats on your discovery. Take care.

      Comment

      Working...