Solved

How use date field to automatically populate 4 other fields

Posted on 2013-11-07
1
345 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
1 Comment
 
LVL 57

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now