Run code in Macro
I am trying to create a macro that will run
this code by using Runcode action.
The code is show below. What do I need to do to make this work.
#CODE#
Public Function SepData()
Dim rst As Recordset
Dim db As Database
Dim i As Long
Dim MySeparator() As String
Dim fld As String
Set rst = CurrentDb.OpenRecordset("tblSymantece-mailSplit", dbOpenTable)
With rst
Do Until .EOF
MySeparator = Split(rst.Fields("Notes_Move").Value, "&")
.Edit
For i = 0 To UBound(MySeparator)
fld = "column" & i
.Fields(fld).Value = MySeparator(i)
Next i
.Update
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing
End Function
#END CODE#
Thanks
Corey
|