Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text box

Status
Not open for further replies.

Zorro1265

Technical User
Nov 14, 2000
181
US
I have a bound text box on my form. It is used to make an ammendment to a finished report. The finished report is locked and the controls to use it are disabled when the lock is in place. The ammendment feild is only active if the lock is in place. What I want to do is after the ammendment feild is changed I plan on it becoming disabled something like if me!ammendment is notnull then me!ammendment enabled = false. Once that feild has text in it I want to add my own string in front of whatever was typed in. I want to add "***Ammendment to original report***CurrentDate***" and then the text that was typed in will be moved down one line. Is this possible and how should I go about it.

Thanks Zorro
 
This code will add the text to the textbox and move current text down one line when you click on the lock checkbox.

Private Sub ChkLock_Click()
If ChkLock.Value = True Then
If TextBox1.Text <> &quot;&quot; Then
TextBox1.Text = &quot;***Ammendment to original report***&quot; & Date & &quot;***&quot; & Chr(13) & TextBox1.Text
TextBox1.Enabled = False
End If
End If
End Sub

Note: TextBox1.MultiLine must be True.

I hope this helps.
 
This has me really close Darksun thanks!! I am going to put this on the exit event because when the ammendment box is used the lock is already in place. If the lock isnt checked the ammendment isnt active. One problem I am getting is the date is coming up as the date of the original report, I would like the current date (so when the ammendment is done) to appear. I am using Access97, where is the multiline that you mention? Zorro
 
Never mind I got it, in case anyone else is faced with this I got this to show me the current date.

Format(Now, &quot;Short Date&quot;)

As for the multiline I just put in a carriage return and a line feed and is seems to be ok. Zorro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top