Code problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • richhemmings
    New Member
    • Mar 2006
    • 3

    #1

    Code problem

    Hi!

    having problems with a bit of code, can anyone help me out?

    Set rs = CurrentDb.OpenR ecordset("SELEC T [Match_ID] FROM [tbl - Availability] WHERE [Match_ID]='" & Match_ID & "'")

    I get a "3464 - data type mismatch in criteria expression" error

    Thanks

    Rich :confused:
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Now this is a guess but from it's name I would have thought that Match_ID was a number (IDs normally are) but you seem to be comparing it with a string " & Match_ID & ".

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #3
      If Match_ID is a Number, this should work:
      Set rs = CurrentDb.OpenR ecordset("SELEC T [Match_ID] FROM [tbl - Availability] WHERE [Match_ID]=" & Match_ID)

      If Match_ID is a String, try this:
      Set rs = CurrentDb.OpenR ecordset("SELEC T [Match_ID] FROM [tbl - Availability] WHERE [Match_ID]='" & Match_ID & "'")

      Comment

      Working...