I'm trying to update a record. but i get the following error: Data type mismatch in criteria expression. error: -2147217913
I have spent 4 hrs and i can't find the solution. I'm going crazy. Is it because i'm using an array? the debuging points to the .open
the Course_Registration_ID field in access is my Primary Key and is autonumber.
the intCourseID , i have changed to long and it doesn't work either.
Dim intCourseID as integer
intCourseID = txtCourseID(index).Text
strSQL = "SELECT * FROM Course_Registration "
strSQL = strSQL & "WHERE Course_Registration.Course_Registration_ID = '" & _
intCourseID & "'"
.ActiveConnection = cnConn
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Source = strSQL
.Find "Course_Registration_ID = '" & intCourseID & "'"
.Fields("Certificate") = txtCertificate(index).Text
.Fields("Certificate_Date") = Date
Set recCertificate = Nothing
do you know what i am doing wrong?? thank you so much.