?
Solved

How use date field to automatically populate 4 other fields

Posted on 2013-11-07
1
Medium Priority
?
391 Views
Last Modified: 2013-11-07
On a form I have a date field... txtInvDate   After the user has entered a date in this field (short date format), I would like 4 other fields to automatically populate. They are:

(using for example 12/5/13 as the date entered in txtInvDate)

txtInvMonth (should populate with 12)
txtInvYear (should populate with 2013)
txtInvQuarter (should populate with 4 since December is in the 4th quarter)
txtFinancialyear (should populate with 2013)

What would the code be for the afterupdate event of txtInvDate ?

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 39631256
Me.txtInvMonth  = DatePart("m",Me.txtInvDate)
Me.txtInvYear = DatePart("yyyy",Me.txtInvDate)
Me.txtInvQuarter = DatePart("q",Me.txtInvDate)
Me.txtFinancialyear = DatePart("yyyy",Me.txtInvDate)

Jim.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question