Adding a event procedure

shakermaker

New member
Local time
Today, 22:28
Joined
Dec 9, 2003
Messages
5
Good Morning
I would like to add an event procedure where I can double click a text box in a form and it will show the exact time i double clicked it.

Thanks for anyhelp you can give me

Neil Bond
 
shakermaker,

Try the following code in the On Click event of the textbox to have the time and date shown with a message box where the textbox name is txtWhatTime:

Private Sub txtWhatTime_DblClick(Cancel As Integer)

MsgBox "This box was clicked: " & Time & Date, vbOKOnly, "What time was it?"

End Sub


Try the following code to have the time and date entered into the textbox itself where the name of the textbox is txtWhatTime2:

Private Sub txtWhatTime2_DblClick(Cancel As Integer)

Me.txtWhatTime2.Value = Time & " " & Date

End Sub


HTH Skip
 
You could replace Time and Date with Now
 

Users who are viewing this thread

Back
Top Bottom