View Full Version : current date button


bricklebrit
04-03-2002, 02:49 AM
Hello,

I am attempting to create a button that when clicked in the form that will put the current date in the [OrderDate] field. Is there a simple command to to do this?

Thanks in advance for your assistance!

Graham T
04-03-2002, 03:09 AM
briclebrit

Try the following:


Private Sub [YourButtonName]_Click()

Me![YourFieldName] = Date

End Sub


HTH

bricklebrit
04-03-2002, 03:13 AM
HTH -

Thanks for the prompt response -- works brialliantly.

David R
04-03-2002, 07:32 AM
You can also set your OrderDate field to Default: Date(), that way a new record will automatically have this without the extra buttonclick. That may not serve your needs, just giving an alternative option.

Good luck,
David R