koolzap351:

The following code will put the current date into a text box when you click on the text box:

Private Sub txtDate_Click()
If txtDate.Text <> CStr(Date) Then
txtDate.Text = Date
End If
End Sub

If you want to have the date appear in the text box when the form loads, then put this code in the form_load event instead of the txtDate_Click event.


This code will put the current time into a text box when you click on the text box:

Private Sub txtTime_Click()
If txtTime.Text <> CStr(Time) Then
txtTime.Text = Time
End If
End Sub

Again, if you want the time to appear in the text box when the form is loaded this code need to be in the form_load event.

This should work.