Memo Field - Double Click to Add Date.

C

Curt Gordon

I would like to allow the user to double click inside a
memo field and have the current date and time entered
automatically at the cursor point. Does anyone know if
this is possible? This memo field contains comments that
need to be dated as they are entered. The user could
enter the date manually or I could create a more
complicated design with another table, but I was hoping
they could just double click and have the current date
entered for them.

I tried the expression =Now() in the double click
property, but nothing happens.

Thanks,
Curt Gordon
 
D

Dan Artuso

Hi,
Try this amd see if it works for you:

Private Sub test_DblClick(Cancel As Integer)
Dim intStart As Integer
Dim strTemp As String

intStart = Me.test.SelStart
strTemp = Left(Me.test.Text, intStart) & " " & Date & " "
Me.test = strTemp & Mid(Me.test.Text, intStart + 1)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top