Enter quarter automaticly based on date entered

N

Nick

I have a form where the "oTDLdaTE" field has to be entered and would like the
quarter it belongs to entered in the "quarter" field automaticly. Currently
it has to be entered in to the "Quarter" text box and sometime it is entered
incorrectly.
I have not worked much in the property area of the forms or text boxes and
would like to get a better idea how it should be used: where it be after
update or before update and so on.
Quarter 1 would be between 01/01/2*** and < 04/01/2***
Quarter 2 would be between 04/01/2*** and < 07/01/2*** and so on.
the oTDLdaTE data is entered as 01/01/20**
Please keep it simple, I really want to learn this stuff.
Thanks.
 
R

Rick Brandt

Nick said:
I have a form where the "oTDLdaTE" field has to be entered and would
like the quarter it belongs to entered in the "quarter" field
automaticly. Currently it has to be entered in to the "Quarter" text
box and sometime it is entered incorrectly.
I have not worked much in the property area of the forms or text
boxes and would like to get a better idea how it should be used:
where it be after update or before update and so on.
Quarter 1 would be between 01/01/2*** and < 04/01/2***
Quarter 2 would be between 04/01/2*** and < 07/01/2*** and so on.
the oTDLdaTE data is entered as 01/01/20**
Please keep it simple, I really want to learn this stuff.
Thanks.

Real easy. Eliminate the quarter field entirely from your table. You don't
need it and it would be a redundancy to keep it. All you have to do to
*display* the quarter anywhere you need it is to apply an appropriate format to
your date field.

For example, on your form you would have two controls bound to your date field.
In one of them you would set the format property to "q" (without the quotes).
As soon as you enter a date the quarter will automatically appear in the other
control.
 
N

Nick

I like what you are saying but am having difficulty understanding it could
you give me an example. Thanks!
 
R

Rick Brandt

Nick said:
I like what you are saying but am having difficulty understanding it
could you give me an example. Thanks!

Pretty sure I did :)

Make another TextBox bound to your date field. You can even just copy the one
you have if you like. On the format tab of the property sheet for the new
TextBox enter a single letter Q in the format property. That will cause the
TextBox to display the quarter that corresponds to the date instead of the full
date.
 
N

Nick

Thank You! I appreceate your patience. I followed your instructions and it
works great.
 

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