Help adding "text" (ENTER) and more text using VB

chapmajm

Registered User.
Local time
Today, 12:13
Joined
Mar 22, 2007
Messages
28
Hi all,
I have check boxes that automatically input text into fields on forms. I use this code...

Private Sub Check88_AfterUpdate()

If Me![Check88].Value = False Then Me![VisitHistory] = Null
If Me![Check88].Value = True Then Me![VisitHistory] = "Additional text."

DoCmd.RunCommand acCmdRefresh

End Sub

Problem is, I need to create check boxes that auto input paragraphs of text into a memo field. Example of text I need to input...

" 1. The history is consistent with sleep apnea.
a. This history of snoring....
b. The consequences of sleep apnea...."

Please notice that I have to hit enter several times to get to the next line and that is also how I want the text to appear on the report.

So, how do I tell the checkbox to type in multiple lines of text and place NEXT LINES in certain areas?

I have tried searching the help files and can't figure out what the name of my problem is to type in a help topic. Even if someone could point me in the right direction, that would be great.
 
"Your text" & vbCrLf & "more text" & Chr(13) & Chr(10)
 
"Your text" & vbCrLf & "more text" & Chr(13) & Chr(10)

Hi! Thanks for replying.
So does the vbCrLf make a new line or something? What does the Chr(13) & Chr(10) do?
 
vbCrLf adds a Carriage Return (Chr(13)) and a Line Feed (Chr(10)) for those of us that remember typewriters. Both ways do the same thing, I was just showing you two ways to do it.
 
I see now. Okay, thanks! I will give it a shot and get back to you. I appreciate your help.
 
Hey Guy,

Well, it worked. Thanks for your help. It came in very handy. I like using the vbCrLf. You helped me out a lot. It's amazing how much smarter you people are making me.

-Jenny
 
You are welcome Jenny. All it takes is a little time! ;)
 

Users who are viewing this thread

Back
Top Bottom