Access 2007-2016
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  
Tips & Tricks

New Tips Added Weekly!
Click here to get on our Mailing List


Default Value

Insert the current date and time with the default value field property

In this Microsoft Access video tutorial, you will learn how to use the Default Value property in your tables to automatically insert the current date and time into new records. This is great for work logs, order entry, or anything else that requires a date/time stamp. You can learn more about the Default Value property, and many of the other table field properties in my Access 2010 Beginner Level 3 Tutorial.

Have you ever wanted to automatically insert the current date and time into your Microsoft Access database records? You can do this with the Default Value property. You can use this for work logs, order entry, time tracking, or anything else that requires a simple date/time stamp to be automatically entered each time you create a new record.

Take, for example, a simple table with three fields: an ID (AutoNumber), a DateTime field (Date/Time data type), and a Description field (Text). As you enter records into the table, you are forced to manually type in the current date and time for each record. This can be quite laborious, even with the Date Picker button, because you still have to type in the time. It would be nice if there was a way for Access to automatically insert the current date and time for you.

Open your table in Design View. Click on the DateTime field and notice the list of field properties at the bottom of the window. Find the Default Value property. The Default Value is the value that a new record starts out with. You can change it if you want, but Access will create new records with this value. You can set the Default Value to a static value. For example, if most of your customers are from New York, you could set the Default Value for a State field to �NY�. In this case, we want the current date and time to be inserted.

In order to have a Default Value that inserts the current date, type the following into the Default Value property:


This is the Date Function. Notice the empty parentheses. This indicates to Access that you�re dealing with the Date Function, and not just the word �Date.� The Date Function returns the current date and places it in this field. Since Date() doesn�t return the time, we�ll get today�s date at midnight. If you save the table and switch over to Datasheet View, you�ll see that the next new record will be created with today�s date. Now, we want the current date with the current time. So instead of Date() type in:


The Now Function returns the current date along with the current time. This will allow you to create a date/time stamp for your record. Each time you enter a new record, the date and time are inserted automatically for you.


By Richard Rost   Richard Rost on Facebook Richard Rost on Twitter Richard Rost on Google Plus Richard Rost on LinkedIn Email Richard Rost

Click here to sign up for more FREE tips


You may want to read these articles from the 599CD News:


Visual Basicindex
Account Login
Online Theater
Lost Password
Free Upgrades
Insider Circle
Student Databases
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Live Chat
Customer Support
WalkThru Tutorials
Consulting Services
About Us
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Gift CDs
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP