我想验证一个字段,以检查它是否满足字母数字规则的组合。提交表单后出现的错误是“参数不可选”
Dim db As Database
Dim rs As Recordset
Dim myRegExp As RegExp
Dim myMatches As MatchCollection
Dim myMatch As Match
Set myRegExp = New RegExp
myRegExp.Global = True
myRegExp.pattern = "[a-zA-Z0-9]$"
Set myMatches = myRegExp.Execute(Me.NRIC)
If Not myMatches Then
MsgBox "NRIC/FIN must be combination of numeric and letter!"
Cancel = True
Me.NRIC.SetFocus
End If