Datatype mismatch error showing whenever you try to compare two different datatype so if field datatype is number just compare it "FieldName=" & formName.ControlName, if it text Datatype then "FieldName='" & formName.ControlName & "'"
Here you can see that i have added sigle quote on text...