这一列,要用字符列,不能用数值列。
如果要检测电话是否正确,表ValidateEdit事件
If e.Col.Name = "联系电话" Then
Dim str As String = e.text
Dim reg As new System.Text.RegularExpressions.Regex("((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)")
If reg.Ismatch(str) = False Then
msgbox("号码有误")
e.cancel = True
End If
End If