str1 = "SELECT * FROM CancelTracking WHERE [Tracking#]= & txtTracking ;"
A couple of things wrong. Anything within the quotes will be treated as text, so you need to resolve the variable before putting it in the string (str1). Also, a text variable must be surrounded by quotes. chr$(34) equals "
str1 = "SELECT * FROM CancelTracking WHERE [Tracking#]= "
str1 = str1 & chr$(34) & txtTracking & chr$(34)