I have a table that includes a Date field (I’ll call it Date_field_1 here just to simplify things). I have a second date field (in the same table) that I’ll call Date_field_2.
Date_field_1 already has data in it. I need Date_field_2 to automatically default to a value that is Date_field_1 plus 2 years. For instance, if Date_field_1 has a value of 2/15/05, I need Date_field_2 to automatically default to 2/15/07. How can I make this the default?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Default value of date field (Access 2003)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Default value of date field (Access 2003)
- This topic has 10 replies, 3 voices, and was last updated 16 years, 6 months ago.
AuthorTopicWSlconway
AskWoody LoungerDecember 2, 2008 at 7:21 am #455719Viewing 0 reply threadsAuthorReplies-
WSDJLansing
AskWoody Lounger -
WSlconway
AskWoody LoungerDecember 2, 2008 at 7:49 am #1135664Sorry to be difficult. I’m sure this is an easy issue for most of you, but I am not experienced in this particular area of Access. Where exactly are you inputting that? I am looking in the Properties information for Date_field_2, in the Default value field. Is there a way to program the Default value to be 2 years after the value in Date_field_1? Or do I have to do some sort of update query to populate Date_field_2? (I want to try to make this a default value rather than having the user periodically run an update query to populate Date_field_2 because I want to ensure that if there is a value in Date_field_1, there is always a value in Date_field_2. Does that make sense?
-
WSDJLansing
AskWoody Lounger -
WSlconway
AskWoody LoungerDecember 2, 2008 at 7:59 am #1135667Not necessarily. Most of the records already have data in Date_field_1. For future records, sometimes the user is typing directly into a table. Sometimes she is going to use a form. So the main thing I’m worried about is getting the new field that is currently blank (Date_field_2) populated automatically based on the value that is already in Date_field_1. There are already MANY records in the table, and all already have a date in Date_field_1. I need to have Date_field_2 automatically populated based on the value in Date_field_1, regardless of whether the data is already filled in or whether it will be added or updated in the future. Does that make sense? Thank you in advance for your patience! (I have more experience with Queries and Reports and not much experience with calculations in Access!)
-
WSjohnhutchison
AskWoody LoungerDecember 2, 2008 at 8:27 am #1135677If you let user type data directly into a table, there is no way to automatically fill one field with a calculation based on another field. As Don suggested, this requires you to use forms.
But if the second date is ALWAYS 2 years after the first, it should not be stored in the table at all. One of the general principles of Access is that you don’t store things that can be calculated..
The calculation can be performed in a query where you add the calculated field : Date_field_2 : DateAdd(“yyyy”, 2, [Date_field_1])
Anytime you want to see this second date, you look at (or have a form or report that uses) this query rather than the table.
-
WSlconway
AskWoody LoungerDecember 2, 2008 at 8:36 am #1135680Point well taken on not storing data that can be calculated. I will talk with the users further to see how they are going to USE that 2nd date field. I have seen one new report that needs to display that data. I can certainly modify the query or the report it is based on to do the calculation as you provided. My worry is that they will need to use it in a number of different queries and reports, which would require them to be able to understand and type in the calculation frequently when they need it. Based on the queries and reports they are already using with the data, I may be able to talk them out of having the 2nd field exist at all! If they must have the second field appear, I will most likely do the combination of an update query to update the current data, and then add something to their data entry form to ensure that NEW records will have the correct value in Date_field_2. Thanks everyone. I’ll do one more post after I meet with the user again to figure out what will work best in these circumstances.
-
WSjohnhutchison
AskWoody LoungerDecember 2, 2008 at 8:53 am #1135684If you create one query that contains the calculation, then you can base any further queries/reports on that first query. That way the calculated field is available, and no-one ever needs to redo the calculation.
You can base the data entry form on the query as well, so the second date will appear on the form as soon as the first date is entered.
-
WSlconway
AskWoody LoungerDecember 2, 2008 at 9:00 am #1135699Yes–I at least know that much, but I appreciate the idea because you could not assume I knew that about queries.
What I’m worried about are all of the existing queries that the users already have that now need to include this new piece of data. And they will all be creating their own queries and reports in the future. They may base them on OTHER queries rather than this query. I really can’t stop them from doing so. That’s why I was trying to make the new date field a whole separate field in the table. The users KNOW how to add another field to their queries. And they know how to create new reports. By making the second date field a separate field in the table, the users can easily USE it in everything they do without THEM having to understand how to add the calculation to each new query or report they create in the future. Make sense?
-
WSjohnhutchison
AskWoody Lounger -
WSDJLansing
AskWoody LoungerDecember 2, 2008 at 8:28 am #1135678If your entering directly into the table I know of now way to auto populate the second date. Someone else will have to help you there.
To update the all the fields regardless of what is in Date_Field_2 with a year that is two years greater than the date in Date_field_1 use the following query.
UPDATE YourTableName SET YourTableName .Date_field_2 = DateAdd(“yyyy”,2,[Date_field_1]);
In your data entry form go to the design mode and select your Date_field_1 textbox. Go to its properties (right click on it and select properties)
Select the Event tab and click the After Update and select Event Procedure. Then insert the code I gave above.
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Excessive security alerts
by
WSSebastian42
3 hours, 29 minutes ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
4 hours, 17 minutes ago -
Ben’s excellent adventure with Linux
by
Ben Myers
15 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
5 hours, 29 minutes ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
1 hour, 20 minutes ago -
OS news from WWDC 2025
by
Will Fastie
5 hours, 31 minutes ago -
Need help with graphics…
by
WSBatBytes
4 hours, 12 minutes ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
19 hours, 45 minutes ago -
Totally remove or disable BitLocker
by
CWBillow
18 hours, 38 minutes ago -
Windows 10 gets 6 years of ESU?
by
n0ads
6 hours, 34 minutes ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
1 day, 6 hours ago -
Search Forums only bring up my posts?
by
Deo
1 day, 6 hours ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
1 day, 18 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
1 day, 10 hours ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
1 day, 18 hours ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
2 days, 4 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
2 days, 6 hours ago -
Disengage Bitlocker
by
CWBillow
1 day, 20 hours ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
2 days, 8 hours ago -
New Win 11 Pro Geekom Setup questions
by
Deo
1 day, 6 hours ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
2 days, 15 hours ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
2 days, 15 hours ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
2 days, 19 hours ago -
New PC transfer program recommendations?
by
DaveBoston
1 day ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
2 days, 23 hours ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
2 days, 23 hours ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
2 days, 11 hours ago -
The end of Windows 10 is approaching, consider Linux and LibreOffice
by
Alex5723
1 day, 15 hours ago -
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
2 days ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
3 days, 18 hours ago
Recent blog posts
- Ben’s excellent adventure with Linux
- Seconds are back in Windows 10!
- WebBrowserPassView — Take inventory of your stored passwords
- OS news from WWDC 2025
- Best tools for upgrading a Windows 10 to an 11
- Master patch listing for June 10, 2025
- 24H2 may not be offered June updates
- June 2025 updates are out
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.