Hi,
Thank you for using MSDN Newsgroup! It's my pleasure to assist you with
this issue.
From your description, I understand that you would like to suppress the
error message and set the field to be empty if the entering data mismatches
the data type. Have I fully understood you? If there is anything I
misunderstood, please feel free to let me know.
If you'd like to perform this in a Table, I'm afraid there is no better way
except that you use the Volidation Rule and Volidation Text to notify
customer to enter the proper data. For a form, you can use VBA to suppress
this message with DoCmd.SetWarnings (False) and set the field to be empty
with Me.col1 = "". Additionally, you need to unbound that column first and
after that update the underlying table. Please see the following code and
apply on your side.
'''''''''''''''''''''''''''''''''''''''''''''''
Private Sub c2_AfterUpdate()
If Err.Number = 0 Then
Me.col1 = ""
End If
DoCmd.SetWarnings False
DoCmd.RunSQL "update table1 set col1 =" & """""" & " where ID = " & Me.ID
DoCmd.SetWarnings True
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''
Does this answer your question? Please notify me if this helps resolves
your problem. If there is anything we can still assist you on this issue,
please feel free to let me know.
Best regards,
Billy Yao
Microsoft Online Support