Can not figure out why I get a "data type mismatch in criteria expression" when the criteria is a string and the access data base field is "Text". "Crew" is a field name in Access data base and it's data type is "Text".
Private SubButton1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim sql AsString
Dim val AsString
val ="44"
sql ="select * from gmBasic where Crew = " & val & ";"
GmBasicTableAdapter.Adapter.SelectCommand.CommandText = sql
GmBasicTableAdapter.Fill(MaintSkills2016DataSet.gmBasic)
End Sub
Private SubButton1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim sql AsString
Dim val AsString
val ="44"
sql ="select * from gmBasic where Crew = " & val & ";"
GmBasicTableAdapter.Adapter.SelectCommand.CommandText = sql
GmBasicTableAdapter.Fill(MaintSkills2016DataSet.gmBasic)
End Sub