display date then new line

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
I have a form containing a number of fields. When the user clicks in a field
I would like it to display the current date, then position the cursor at the
start of the next line ready for the user to start typing. I can display
the date, but I cant get the cursor to go to the next line. Code is as
follows:

Private Sub Text0_Enter()

Me.Text0 = Left(Now(), 8) & vbCrLf

Me.Text0.SelStart = Len(Me.Text0) - 2

End Sub

This displays the date with the cursor at the end. If I omit the '-2' in
the selstart line, the date is obliterated and the cursor is set at the start
of the field.
Any help would be much appreciated as always.
 
Are you sure it is a the beginning of the field or is it at the beginning of
the 2nd line? Do you now have a verticle scrill bar? Make the TextBox
taller as a test and see what is happening.
 
Private Sub Text0_Enter()
Me.Text0 = Left(Now(), 9)
Me.Text0.SelStart = Len(Me.Text0) - 0
SendKeys "^~"
End Sub

Damon
 
Back
Top