If it's a string field, you need single quotes around it.
vb Code:
cmdUserSelect.CommandText = "SELECT ShapeID, " _ & "Shape, Colour " _ & "FROM Features WHERE Shape = '" & Me.shape.Text & "'"
Also, read this MSDN article on SQL Injection to learn why you have to be very careful about appending user supplied strings into SQL statements.![]()




Reply With Quote