Insert current date in text box on got focus

rbrule

Registered User.
Local time
Today, 15:06
Joined
Jan 13, 2004
Messages
108
I have a form with two text boxes in which I would like to insert the current date automatically when the text box has got focus. Default value doesn't work because the current date may occur on two different days, and the default has to be null until the current date is inserted.

Can someone walk me through the process? Thank you.
 
Define an On Got Focus event on your text box.
Use this code:

Me.NameOfDateTextbox = Date

Default value doesn't work because the current date may occur on two different days

I suspect you also would have to check within your code whether you're dealing with a new record or are updating an existing record.

RV
 
Could also make a small button next to it with the caption "Today".
Button_Click event:
me.[MyDateControl] = Date
 
Thanks, I'll try them both and see which works better in this application.
 

Users who are viewing this thread

Back
Top Bottom