As a followup here is some code to extract data from line in a memo field.
First in my example I have a memo field that has multiple lines like so
1. This is line 1
2. This is line 2
3. This is line 3
Notice I need some kind of identifier to identify the start of each line. I would recommend you find something very UNIQUE (not what I used)
The code to extract line 1 and 2 is as follow. You can expand on it by using loops, case statements etc.
-
' what line number do you want to search for
-
vLine = 1
-
' get the starting position of the 1st occurance of the value stored in vLine
-
vStart = InStr(1, txtMemo, vLine)
-
' figure out where the next line starts
-
vEnd = InStr(1, txtMemo, vLine + 1)
-
'display the line number on the form
-
Me.txtLine1 = Mid(txtMemo, vStart + 2, vEnd - vStart)
-
'same as above but for line 2
-
vLine = 2
-
vStart = InStr(1, txtMemo, vLine)
-
vEnd = InStr(1, txtMemo, vLine + 1)
-
Me.txtLine2 = Mid(txtMemo, vStart + 2, vEnd - vStart)
-
As you can see if searching for say Line 1 if the number 2 appears in line 1 then everything will be messed up. But it gives you an idea of how it can be done.
Hope this helps - please feel free to ask for more clarification.