VBA to fill in fields with text, including paragraphs

sebastian341

Registered User.
Local time
Today, 15:00
Joined
Jun 11, 2009
Messages
21
In a form in my database the user selects one of several "record types." Records which have the same "record types" usually have a very similar memo field, although there may be slight variations.

What I want to do is to have the memo field automatically filled in with a "default" memo data when the user selects an appropriate "record type." The memo data would then be modified slightly by the user to suit that particular record, or changed entirely, but in most cases few changes will be made.

I know how to do this with text information, but is there any way to include paragraphs in the memo data, as if they were typed in a word document, using the "enter" key to signify a new paragraph? The user would choose a type and then immediately after (after an onUpdate event) the text in the memo field would change to text, but formatted in paragraph form.]

tl;dr, how do you add paragraphs to Strings (or some other appropriate data type)
 
To add paragraphs in a control when typing, use ctrl-enter for a new line.

In VBA code use:

... = "paragraph 1 text" & vbCRLF & vbCrLF & "paragraph 2 text"
 
That's exactly what I was looking for, thank you.
 

Users who are viewing this thread

Back
Top Bottom