New Line in Comment Box

galvinjaf

Registered User.
Local time
Today, 10:02
Joined
Jan 5, 2016
Messages
108
Good Morning,

As I go back and try to refine my database, I am trying to tweak the code that will place a new space between comments in my comment box. It'd be easier on the eyes to see a space in between comments from other users. Right now, when someone updates the comment box, there are not line breaks between the text. I'd like to have a full line space. Here is the programming, and attached is a pic of the comment box.

Option Compare Database

Private Sub AddComment_Click()
If Not IsNull(Me.txtComment) Then
Me.txtComment = vbNewLine & Me.txtComment

End If

Me.txtComment = Now() & " - " & TempVars("sUsername") & " - " & Me.txtNewComment & Me.txtComment

Me.txtNewComment = ""
End Sub
 

Attachments

  • Comment Box.JPG
    Comment Box.JPG
    32.2 KB · Views: 102
Would this work?
Code:
 Private Sub AddComment_Click()
      If Not IsNull(Me.txtComment) Then
           Me.txtComment = vbNewLine & Me.txtComment
      End If

      Me.txtComment = Now() & " - " & TempVars("sUsername") & " - " &  Me.txtNewComment & vbNewLine  & Me.txtComment

     Me.txtNewComment = ""
End Sub
 
Would it? YES! I swear I did that, and it didn't work. Thanks again!
 
Not sure what you really want, but you could try changing

Me.txtComment = vbNewLine & Me.txtComment

to

Me.txtComment = vbNewLine & Me.txtComment & vbNewLine

as a test .
 
has it been solved?

Code:
Private Sub AddComment_Click()
    If Trim(Me.txtNewComment & "") <> "" Then
        Me.txtComment = Me.txtComment & vbNewLine & _
        Now() & " - " & TempVars("sUsername") & " - " &               Me.txtNewComment    
    End If
    Me.txtNewComment = ""
End Sub
 

Users who are viewing this thread

Back
Top Bottom