Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How use date field to automatically populate 4 other fields

Posted on 2013-11-07
1
Medium Priority
?
398 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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 …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

610 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