Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting up a field to add date when clicked 5

Status
Not open for further replies.

scoobs70

Technical User
Sep 9, 2004
9
US
I have a question about adding dates in forms and subforms. I would like to be able to double click in a field and have it put in todays date. Currently I am using the hot key control;. I have looked through many different help sections and have not found anything that makes this happen. I appreciate any help.

Thanks,
Scoobs70
 
In the dblclick event just add the line:

Me.Text0 = Date

where text0 is the name of your field on the form.



[flush]

DBAMJA

It is said that God will give you no more than you can handle. I just wish God didn't have so much faith in me.
 
Suggestion ..... you may want to consider using the default value of the date fields by putting
=Date(). This will automatically put today's date. If you wish to change, that would not be a problem. Accss will save whatever appears in that field.

An investment in knowledge always pays the best dividends.
by Benjamin Franklin
Autonumber Description - FAQ702-5106
 
How are ya scoobs70 . . . .

Try: Me!ControlName = [blue]Int(Now())[/blue]

Calvin.gif
See Ya! . . . . . .
 
I tried each code but I don't think I am doing it right. I am getting a message that say access can't find the macro. I am pretty new at this stuff so I'm sure I am missing something. The field I am trying to add the double click function to is on the subform. I went into design view and clicked on properties, on dblclick, and then added the codes.
Thanks again for you continued help
scoobs70
 
Guessing - you've put it in the double click event in the properties dialog? If so, remove it, and click the button with the three small dots at right on that line, to enter VBE, and enter the code there. Substitute Text0 in DBAMJA's suggestion with the actual name of your control, and then it should work.

Roy-Vidar
 
That helped a lot. Thank you for all the help
scoobs70
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top