Add current date to text box

tegb

Registered User.
Local time
Yesterday, 22:37
Joined
Feb 14, 2012
Messages
49
I have a text box named "Update"

I am trying to
  • auto populate atextbox with current date
  • Cursor to stay at the end of date & be ready for user input
  • user to key-in text at the end of date
I used the on-click event to add current date, however when the user wants to key-in input, the date disappears.

How can I get the date to stay there & yet allow the user to enter text?
 
As posted on your other thread,

Look at SelStart and SelLength in VBA help.
 
Hi,

Personally I would use the OnGotFocus event to add the date and then move the cursor to the end of the text with the following code:

Me.ActiveControl.SelStart = Len(Me.ActiveControl.value)

Of course, you can also substitute the actual control name for ActiveControl.

Good luck. :)
 

Users who are viewing this thread

Back
Top Bottom