Link to home
Start Free TrialLog in
Avatar of Lawrence Salvucci
Lawrence SalvucciFlag for United States of America

asked on

Default text in Memo Field

I need to add some default text to a memo field on my form but not sure how to do that if I need the text on multiple rows with spaced rows in between them. Just not sure how to write that in the "Default Value" property. My memo field has a height of 2" so you can see multiple lines when the form is opened. Can anyone shed some light on this one please?
ASKER CERTIFIED SOLUTION
Avatar of Anders Ebro (Microsoft MVP)
Anders Ebro (Microsoft MVP)
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lawrence Salvucci

ASKER

Thank you both for your quick responses. Is there a limit on what you can put in the Default Value property for a memo field? When I say limit I mean # of characters & lines.

Sorry for using the word ROW. I realized that afterwards that it can be confused with records. I meant LINES.
In a quick test, I tried placing a string of length 1000 characters into the defaultvalue, and that worked.

If there was a limit, I would presume it was at 256 characters. So I think you should be good to use any length strength (within reason).
Thank you both for your help! I appreciate it!!
you might want to consider simply using the Current event.  Then you could test to determine whether the record is a new record and if so, then populate the particular value you are looking for, something like:
Private Sub Form_Current

    if me.newRecord then
        me.txt_MemoControl.Value = "line1" & vbcrlf _
              & "line2" & vbcrfl & vbcrlf _
              & "line3" & vbcrlf _
              & "line4"
    end if

End Sub

Open in new window

This might be easier to read than simply putting all of that string stuff into the Default Value of the control or the field.