automatic update datetime fields
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Access Training and help » Automatic update to date/time fields?

Automatic update to date/time fields?

resolvedResolved · Urgent Priority · Version 2003

replyReply Wed 14 Jan 2009, 14:14Delegate Gail said...

Gail has attended:
Access Intermediate course
Excel Advanced course

Automatic update to date/time fields?

Is there a way to get Access to automatically update a date/time field when a record is created or changed?

For upcoming training course dates see: Pricing & availability

replyReply Wed 28 Jan 2009, 15:35Trainer Rajeev said...

RE: Automatic update to date/time fields?

Dear Gail

Thank you for attending Access and Excel Courses!! I hope you enjoyed the courses and benefited from them.

This is quite simple.

1. Go to the table design view.

2. Click on the field where you want the updated date. Make sure the Data type is set as Date/Time

3. In the field Properties click where t says Default Value and type in =date()

4. Click on the field where you wan the time to be updated automatically. Ensure that the data type is set to Date/Time

5. In the field Properties click where it says Default Value and type in =time()

6. When you go to the datasheet view you'll be able to see the new record will have the date and time will automatically appear

Normally the default values on an existing field gets copied over if you create a form based on this table.


I hope this has answered your query.

If this has answered your query then I would request you to please mark the question as resolved!! If not and you have a specific question related to this then please post it as a new question and we should be able to provide you the solution for it!!

Kindest Regards


Rajeev Rawat
MOS Master Instructor 2000 and 2003
MCAS Master Instructor 2007

replyReply Wed 28 Jan 2009, 15:57Delegate Gail said...

RE: Automatic update to date/time fields?

Hi Rajeev,

Many thanks for your explanation. It half answers my question, unfortunately it's the half I already knew about ;-)

I think this is easier to explain if I give you an example from my working life:

I receive a report form for a patient John Doe on 1st January.
We have a macro set up so that the data is automatically imported into the Access database, and given a date of 1st January.
A few weeks later, I am given some updated information, and amend John Doe's record in the database. The "date modified" field then needs to be updated to reflect the new date.

IF I remember, I will update the 'date modified' field myself. However this is a very important field for our audits, and it would be very useful if it could be set up so that Access automatically updates this field whenever a record is amended. At the moment if I do as you suggest and edit the Field Properties to =date() and =time(), it gives the correct date/time of the original import, but does not update when I edit the record a few minutes later - which is the more important bit.

I hope this makes sense and that you can help!!

Many thanks,
Gail

replyReply Mon 9 Feb 2009, 09:15Trainer Rajeev said...

RE: Automatic update to date/time fields?

Dear Gail

Thank you for your response.

I have tried to look into this and unfortunately haven't been able to come up with the solution.

Temporarily I can suggest you to use the shortcut key CTRL +; which also inserts current date but doesn

replyReply Fri 20 Mar 2009, 13:37Trainer Rich said...

RE: Automatic update to date/time fields?

Try these:

Version 2003
http://office.microsoft.com/en-us/access/HA010345351033.aspx?pid=CH062526541033

Version 2007
http://office.microsoft.com/en-us/access/HA102358491033.aspx

Regards, Rich

Thu 26 Mar 2009: Automatically marked as resolved.

 

Please browse our web site to find out more about
access 2000 training and other Microsoft training courses.

Access tip:

Splittng a database

Split your database into two (at least).

Keep all of your code, forms, reports, etc. in one 'code' database and all of your tables in another 'data' database which is then linked to the 'code' database.

This makes modifications, updates and back-ups that much easier and allows you to work on a new version of your 'code' database without affecting existing users. It also makes it easier should you wish to convert a single user databases into a multi-user networked version.

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard