View Full Version : Use command button to enter todays date


nicktheblue
11-12-2001, 11:26 AM
Hello forum,

can anybody tell me the code I should attach to a command button to have it insert 'today's' date into a field? I'm sure everybody either:
a)Knows what it is
or
b)Would find it incredibly useful!

Many thanks in advance,

Nick

nicktheblue
11-12-2001, 11:31 AM
Sorry,

just answered my own question by searching the forum...

Private Sub Command120_Click()
Lastattended.Value = Date
End Sub

Thanks all the same!

Pat Hartman
11-12-2001, 04:22 PM
If you want the field to populate automatically rather than with a button click, add -
Date()

As the default.

Oldsoftboss
11-13-2001, 12:20 AM
You can also press ctrl & the semi colon keys together. (This also works in excel)