Memo Field entry

mrssevans

Registered User.
Local time
Today, 14:48
Joined
Nov 15, 2001
Messages
190
I am trying to use this code to automate note entering by allowing the correct spacing and adding user name and time and date. When I use this code all it will do is add one space and two boxes under the user name and time and date. I need at least 2 spaces under the name, time and date and then have the cursor return to the position under the name, time and date. So that it would look something like this:

***User***Time***Date
Message

***User***Time***Date
Message

Here is the code I am working with"
Private Sub Notes_Entry_Click()
Dim intStart As Integer
Me.Notes = "***" & CurrentUser() & "***" & Now() & Chr(13) & Chr(13) & Chr(13) & Chr(10) & Chr(10) & Chr(10) & Me.Notes

intStart = Len("***" & CurrentUser() & "***" & Now() & Chr(13) & Chr(13) & Chr(13) & Chr(10) & Chr(10) & Chr(10))

'Sets the Cursors Starting Position
Me.Notes.SetFocus
Me.Notes.SelStart = intStart
End Sub

Can someone help revise? Thanks in advance. Sam
 
Give this a try:

Dim intstart As Integer
Me.Notes = "***" & CurrentUser() & "***" & Now() & vbCrLf & vbCrLf & Me.Notes
intstart = Len(Me.Notes)
'Sets the Cursors Starting Position
Me.Notes.SetFocus
Me.Notes.SelStart = intstart
 
Thanks for the reply Jack. I did try the code and it is now putting the cursor at the end of the existing notes and I would still like it to have a space below it and it's focus just under the name, date and time. Like this
***Name***Date***Time
Message
(Space)
***Name***Date***Time
Message

So basically it would have to add a line after the Message that is about to be typed. Does this make any sense? TIA
 

Users who are viewing this thread

Back
Top Bottom