Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- strSQL = "SELECT * FROM TblOrder ORDER BY ID"
- Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
- rs.FindFirst ("Len(string) > 13")
- If rs.NoMatch Then
- MsgBox "All good"
- Else
- Do While Not rs.NoMatch
- MsgBox "String over 13 - " & rs.AbsolutePosition + 1
- rs.FindNext ("Len(string) > 13")
- Loop
- rs.FindNext ("Len(string) > 13")
- End If
- rs.FindFirst ("Validation(string, ""123d{10}$"") = False")
- If rs.NoMatch Then
- MsgBox "All are correct pattern"
- Else
- Do While Not rs.NoMatch
- rs.FindNext (Validation(string, "123d{10}$") = False)
- MsgBox "Must start with 978 - " & rs.AbsolutePosition
- Loop
- rs.FindNext (Validation(string, "123d{10}$") = False)
- End If
- If Validation(rs!string, "978d{10}$") = False Then
- Dim regex As Object
- Set regex = CreateObject("VBScript.RegExp")
- With regex
- .Pattern = strPattern
- .IgnoreCase = True
- .Global = False
- .MultiLine = False
- End With
- If regex.Test(StrInput) = True Then
- Validation = True
- Else
- Validation = False
- End If
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement