Update quarter based on date entered

N

Nick

I have a form where I would like the "Quarter" entered automaticly when the
date is entered into the OTDLdaTE text box. Currently it has to be enter
manually into "Quarter" text box. I have not worked in the property area of
the forms or text boxes and do not know if I should start with after update
or before update and in which text box I should use.
Quarter 1 = 01/01/2*** and < 04/01/2*** and so on.
Please make it simple, I would like to learn this stuff.
Thanks
 
J

John Spencer

Don't enter the quarter anywhere. It can be calculated easily anytime
you need it with either DatePart or Format function

Format([OTDLdaTE],"Q") will return a string of 1,2,3, or 4 or a null value.

DatePart("q",[OTDLdaTE]) will return a number of 1,2,3, or 4 or a null

You can use one of the functions above in a query to get the value or
you can use the control source property of an unbound control to display
the value based on the control where you are entering the data for OTDLdaTE

Control Source: = DatePart("q",[OTDLdaTEControlName])


'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top