Is it me or what?
I have a form that containes a memo field which, if the user clicked the 'edit' button, code automatically prepends the user's vba.username and the present date at the beginning of the field, and positions the insertion point for the user following this user/date stamp (i.e. JSmith 04/14/2003: ) but before the last user/date entry (so most recent comment always reside at top of field).
problem is, for some reason the numlock key gets tripped off (tried vba.sendkey'ing it back on - no luck) as soon as the 1st sendkey statement is read.
any clues would be a life saver. Thanks!
Here's the code:
Private Sub Underwriter_Comments_Enter()
Me!Underwriter_Comments.SelStart = 1
If Me!UndoChanges.Enabled = True Then
Me!Underwriter_Comments.SelStart = 1
Me!Underwriter_Comments = VBA.Environ("username" & " " & Date & ": " & vbCrLf & Underwriter_Comments
Me!Underwriter_Comments.SelStart = 1
VBA.SendKeys "^{home}"
VBA.SendKeys "{end}"
VBA.SendKeys "{left}"
End If
I have a form that containes a memo field which, if the user clicked the 'edit' button, code automatically prepends the user's vba.username and the present date at the beginning of the field, and positions the insertion point for the user following this user/date stamp (i.e. JSmith 04/14/2003: ) but before the last user/date entry (so most recent comment always reside at top of field).
problem is, for some reason the numlock key gets tripped off (tried vba.sendkey'ing it back on - no luck) as soon as the 1st sendkey statement is read.
any clues would be a life saver. Thanks!
Here's the code:
Private Sub Underwriter_Comments_Enter()
Me!Underwriter_Comments.SelStart = 1
If Me!UndoChanges.Enabled = True Then
Me!Underwriter_Comments.SelStart = 1
Me!Underwriter_Comments = VBA.Environ("username" & " " & Date & ": " & vbCrLf & Underwriter_Comments
Me!Underwriter_Comments.SelStart = 1
VBA.SendKeys "^{home}"
VBA.SendKeys "{end}"
VBA.SendKeys "{left}"
End If