extractin data from memo field to text field

shadowmaster

Registered User.
Local time
Today, 10:52
Joined
May 11, 2010
Messages
10
hi all
i have 2 forms - main and sub_ the main form have a memo field called ph include date follow by some data. am trying to extract the memo field into the sub form. that every line in the memo field will extract to 2 parts the date part and rest of data part. i found some code that count lines in memo field and try to work around it but am going no where.
did i mention that am new ????
so any help will be appreciated ;)
thanks again
 
man am in hurry :D
and here is the code i found

Dim intLoop As Integer
Dim strMemo As String
Dim strOutput As String
Dim varLines As Variant

strMemo = Me.MyMemoField
varLines = Split(strMemo, vbCrLf)

If IsNull(varLines) = False Then
For intLoop = LBound(varLines) To UBound(varLines)
If InStr(varLines(intLoop), "AAA") > 0 Then
strOutput = strOutput & "AAA appears on line " & intLoop + 1 &
vbCrLf
End If
Next intLoop
Else
strOutput = "Nothing to search."
End If

MsgBox strOutput
 

Users who are viewing this thread

Back
Top Bottom