Memo box loses focus when clicking time and date

Samrasr

Registered User.
Local time
Today, 13:30
Joined
May 5, 2007
Messages
21
Hi,

I have created a time/date stamp that dates the users name with date after their minute and its working fine. The problem is that when i have completed typing my text after a few paragraphs the memo box loses control and diverts to the top of the page when i click the time/and date button I want my users to see they have time and date stamped it.

Its working fine after a couple of lines and sentences but not when im near to the bottom of the page.

I have attached snaps of the problem, please help.
 

Attachments

Clicking on your time/date stamp button will naturally take the focus away from the memo field! So after your code to add the time/date use .SetFocus to return code to the memo field.

Code:
Private Sub YourTimeDateStampButton_Click()
  YourMemoField = YourMemoField & Now 'Set Date/Time
  YourMemoField.SetFocus  'Return focus to memo field
  YourMemoField.SelStart = Len(YourMemoField)  'Send cursor to end of data
End Sub
 
Excellent

That was brilliant, thanks.
 

Users who are viewing this thread

Back
Top Bottom