Access97 - setting a macro to insert current date into a date field

E

Eric Wolfe

I've been looking for a simple way to insert the current date and time into
a record in an open table. It must work with any date formatted field that
the user wants to fill.

I'm able to do this when the record is first opened by setting default value
to =Format$(Now(),"dd-mmm-yyyy") but I'd like to be able to have a key that
I could press that would insert today's date and time into a date/time field
when directly editing a table.

I've tried a lot of things in the Macro window that I thought should have
worked, but haven't. Any pointers will be appreciated.

Thanks in advance,

Eric
 
E

Eric Wolfe

Nevermind! I'm going to answer my own question just for the record.

I did some reading at:

http://www.access-programmers.co.uk/forums/archive/index.php/f-9.html

which said that you could repeat a previous field with ctrl+' so I thought
there might be other smartkeys and searched the Access help file for
apostrophe and found:

To insert the current date CTRL+SEMICOLON (;)
To insert the current time CTRL+COLON :))

Kewl!

Also learned a peck of new things while looking for this one. I luv the
WWW.

Eric
 
B

Beth Melton

In hopes of offering something you haven't discovered regarding the
keyboard shortcuts you found, they work in Excel as well. :)

Note if using Ctrl + ' to repeat a formula, the formula will not
adjust relative to its new location - it will be a duplicate.

Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Office 2007 Preview Site:
http://www.microsoft.com/office/preview/default.mspx
Office 2007 Community Articles/Tutorials:
http://www.microsoft.com/office/preview/community/article_archive.mspx

TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/
 
Top