Data mismatch in criteria expression

_JSincliar

Registered User.
Local time
Today, 08:03
Joined
Dec 9, 2009
Messages
16
I have an unbound text box that will update a table after the text box is updated, however I keep getting the above error when the event runs.
The query runs if I comment out the where clause, and I can't see where there is a data mismatch. They are all strings, and the fields are Text.

Is there something obvious I am overlooking?

Dim strSQL As String
strSQL = "UPDATE tblUsers SET tblUsers.FirstName = " & Chr(34) & Me.txtFirstName & Chr(34) & " WHERE tblUsers.UID = " & Me.cboStudentID
DoCmd.RunSQL strSQL

Thanks,
Jonathan Sinclair
 
The problem was there were no quotes around Me.cboStudentID.
I used Chr(34) before and after to insert the quotes. A useful trick I learned here a little while ago.

Thanks,
Jonathan Sinclair
 

Users who are viewing this thread

Back
Top Bottom