Solved

How use date field to automatically populate 4 other fields

Posted on 2013-11-07
1
387 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 500 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

688 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