In the debug of a vba form, i have this error "mismatched data types in the criterion expression"
I think is wrong the date. The criterios is #. Have I to convert?
Code:
Private Sub btn_find_Click()
Dim tmpRS As DAO.Recordset
Set tmpRS = CurrentDb.OpenRecordset(" SELECT name FROM Person WHERE [Surname]= '" & Me.txt_Surname & "' AND [Date] = '" & Me.txt_Date & "' ")
Me.txt_name = tmpRS.Fields(0)
End Sub
Last edited: