Default text in Text box on button click (2 Viewers)

stu_c

Registered User.
Local time
Today, 06:00
Joined
Sep 20, 2007
Messages
489
Hi all
I have buttons that when clicked provides default text into a text box, I know how to insert this into an empty the text box but how do I do this so it doesn't delete the text already in the text box but on a new line
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:00
Joined
May 7, 2009
Messages
19,245
on the click event:

Dim sText As String
sText = Me!Textbox1 & ""
If Len(sText) Then
sText = sText & vbcrlf & Replace$(Me.Textbox1.DefaultValue, """", "")
Else
sText = Replace$(Me.Textbox1.DefaultValue, """", "")
End If
Me!Textbox1 = sText
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 06:00
Joined
Sep 21, 2011
Messages
14,310
You concatenate the new data with whatever else you need, like vbCrlf
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:00
Joined
Feb 19, 2002
Messages
43,293
Why are you storing multiple pieces of information in one field?
 

Users who are viewing this thread

Top Bottom