New Line in Comment Box (1 Viewer)

galvinjaf

Registered User.
Local time
Today, 14:01
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: 55

Alc

Registered User.
Local time
Today, 14:01
Joined
Mar 23, 2007
Messages
2,407
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
 

galvinjaf

Registered User.
Local time
Today, 14:01
Joined
Jan 5, 2016
Messages
108
Would it? YES! I swear I did that, and it didn't work. Thanks again!
 

jdraw

Super Moderator
Staff member
Local time
Today, 14:01
Joined
Jan 23, 2006
Messages
15,394
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 .
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:01
Joined
May 7, 2009
Messages
19,246
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

Top Bottom