Thomas,
Hello, welcome to Bytes.
You cannot indent only the first line of a memo and not the remainder, or vice versa. So you'll need to split the memo into two parts, a date part and a part without the date.
You will need two text fields instead of one, the first for the date and the second for the memo. Is this a report or a form you are looking at? In a report you would add this code to the Detail OnFormat event:
- Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
-
Dim intDateEnds As Integer
-
-
On Error GoTo Err_DetailFormat
-
-
intDateEnds = InStr(Me!memNote, "M ") ' find the end of the date/time PM or AM
-
Me!txtDate = Left(Me!memNote, intDateEnds) ' get the date and time only
-
Me!txtNote = Mid(Me!memNote, intDateEnds + 2) ' get the note after the date/time
-
-
Exit Sub
-
-
Err_DetailFormat:
-
MsgBox Err.Description
-
Resume Next
-
-
End Sub
-
In this code
memNote is a text box bound to the data field. It should be invisible and the Can Grow property should be false
txtDate is the text box to contain the date field only
txtNote is the text box to contain the part of the note without the date. The Can Grow property should be true, and probably the Can Shrink property also, but that is up to you.
If you are working with a form and not a report, things are trickier because you cannot have unbound text boxes within the detail. You would have to split the content up in the query and then bind the separate parts to text boxes.
Hope this helps,
Jim