UPDATE T_MMA SET WHERE (((T_MMA.CDT_BUSINESS_CLASSIFICATION_CD) Like "*Ind*") AND ((T_MMA.BizCd) Is Null) AND ((RegexMatch([T_MMA].[BUSINESS_NAME_TX]))=True));The 'update-to' value in the query should reflect the category that the function is processing.
Public Function RegexMatch(ByVal parmBusinessName As Variant) As Boolean Static oRE As Object Dim rs As Recordset Dim strCodes As String If oRE Is Nothing Then 'only do this once in the life of the open database Set oRE = CreateObject("vbscript.regexp") oRE.Global = True 'look at all possible matches oRE.Pattern = "([.()+])" 'characters that need escaping 'clean up and concatenate the codes Set rs = DBEngine(0)(0).OpenRecordset("Select Trim(Code) As trim_code from [T_BusinessCodes]") Do Until rs.EOF 'Replace is escaping the characters with a backslash strCodes = strCodes & "|" & oRE.Replace(rs![trim_code], "\$1") rs.MoveNext Loop oRE.Global = False 'stop looking with the first match oRE.ignorecase = True strCodes = Mid(strCodes, 2) 'skip the leading pipe character strCodes = " (?:" & strCodes & ")[ .,;]" 'put finishing touches on the pattern oRE.Pattern = strCodes End If If IsNull(parmBusinessName) Then RegexMatch = False Exit Function End If 'prepend and append a space to the business name and invoke the 'regex .test() method RegexMatch = oRE.test(" " & parmBusinessName & " ") End Function
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE