Run-time error 3464

O

Oli

Hi Folks

I have a rather annoying problem.

I have a form (frm_notes) and when the data has been inputted a
CommandButton is clicked to insert some extra data along with the record.
However, when this button is clicked I am getting:-

Run-time error '3464':
Data type mismatch in criteria expression

I press END. The annoying thing is, despite the error, it seems to go ahead
and work.

The relevate code is:

--------------------------------------------------
DoCmd.SetWarnings False
sqlString2 = "UPDATE tbl_notes SET ContactID='" & Me.ContactID.Value & "'
WHERE NoteID='" & Me.NoteID.Value & "';"
MsgBox sqlString2
DoCmd.RunSQL (sqlString2)
DoCmd.Close
DoCmd.OpenForm "frm_Contacts"
--------------------------------------------------

Anyone see any problems?

TIA
Oli
 
A

ambradnum

Hi Oli

What datatypes are the ContactID and NoteID fields in tbl_notes?
If they are numeric then you probably don't need the single
quotes around the form variables, ie you should be able to have:
sqlString2 = "UPDATE tbl_notes " & _
"SET ContactID=" & Me.ContactID.Value & _
"WHERE NoteID=" & Me.NoteID.Value & ";"

Regards
Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top