datacolchanging事件,写代码限制,如
If e.datacol.name = "身份证" Then
If e.newvalue <> nothing AndAlso e.newvalue.length <> 18 then
msgbox("有错")
e.cancel = true
End If
http://www.foxtable.com/webhelp/scr/0624.htm
或者,在保存的时候,检测
http://www.foxtable.com/webhelp/scr/0628.htm