Hi,
I've this code which i want to update a table. The thing is that i don't get it to work how i want it. I've tried to use a dao-based recordset and loop through the recordset, but then my app hangs.
Can some help me adjust the code to update a table?
code: Public sub Conversion()
Dim oRE As VBScript_RegExp_55.RegExp
Dim oMatches As VBScript_RegExp_55.MatchCollection
Dim strDescription As String
strDescription = <should be a field of a recordset>
Set oRE = CreateObject("VBScript.RegExp")
oRE.Pattern = "^(?[a-z][^]+)\s+)?(?[0-9.]{5,12})\s+)?(.*)$"
oRE.IgnoreCase = True ' Set case insensitivity.
oRE.Global = False ' Set global applicability.
Set oMatches = oRE.Execute(strDescription) ' Execute search.
If oMatches.Count > 0 Then
On Error Resume Next
Debug.Print "Transfercode:" & oMatches(0).SubMatches(0)
Debug.Print "Acct Number:" & oMatches(0).SubMatches(1)
Debug.Print "Description:" & oMatches(0).SubMatches(2)
Else
Debug.Print "Description:" & strDescription
End If
Set oMatches = Nothing
Set oRE = Nothing
End Function
I've this code which i want to update a table. The thing is that i don't get it to work how i want it. I've tried to use a dao-based recordset and loop through the recordset, but then my app hangs.
Can some help me adjust the code to update a table?
code: Public sub Conversion()
Dim oRE As VBScript_RegExp_55.RegExp
Dim oMatches As VBScript_RegExp_55.MatchCollection
Dim strDescription As String
strDescription = <should be a field of a recordset>
Set oRE = CreateObject("VBScript.RegExp")
oRE.Pattern = "^(?[a-z][^]+)\s+)?(?[0-9.]{5,12})\s+)?(.*)$"
oRE.IgnoreCase = True ' Set case insensitivity.
oRE.Global = False ' Set global applicability.
Set oMatches = oRE.Execute(strDescription) ' Execute search.
If oMatches.Count > 0 Then
On Error Resume Next
Debug.Print "Transfercode:" & oMatches(0).SubMatches(0)
Debug.Print "Acct Number:" & oMatches(0).SubMatches(1)
Debug.Print "Description:" & oMatches(0).SubMatches(2)
Else
Debug.Print "Description:" & strDescription
End If
Set oMatches = Nothing
Set oRE = Nothing
End Function