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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memo field line insert 1

Status
Not open for further replies.

ronnies

Programmer
Sep 10, 2000
12
0
0
US
I would like to insert todays date and a blank line at the beginning of a memo data box by clicking a command button, while retaining the data already stored in the memo data box field. Any Help??
 
Hi,

This should do the trick:
Set this code to run on your command button's "on click" event: (change MemoName to match the name of your memo field)

Me!MemoName = Date & "-" & Time
Me!MemoName.SetFocus
me!tblnotes.SelStart = me!tblnotes.SelLength

HTH

jbehrne If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
Sorry,

I didn't read that you wanted to retain the previous notes, so try this:

Dim PrevtblNotes

PrevtblNotes = Me!MemoName

Me!MemoName = PrevtblNotes & Date & "-" & Time & vbCrLf
Me!MemoName.SetFocus
Me!MemoName.SelStart = me!tblnotes.SelLength

jbehrne If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
Thanks!! With a little code modification, this preformed exactly as I desired

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top