Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

Enter quarter automaticly based on date entered

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nick - 06 May 2007 08:24 GMT
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.
Rick Brandt - 06 May 2007 13:36 GMT
> 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
[quoted text clipped - 8 lines]
> 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.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Nick - 06 May 2007 17:15 GMT
I like what you are saying but am having difficulty understanding it could
you give me an example. Thanks!

> > 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
[quoted text clipped - 18 lines]
> As soon as you enter a date the quarter will automatically appear in the other
> control.
Rick Brandt - 06 May 2007 17:32 GMT
> 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.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Nick - 07 May 2007 01:19 GMT
Thank You! I appreceate your patience. I followed your instructions and it
works great.

> > I like what you are saying but am having difficulty understanding it
> > could you give me an example. Thanks!
[quoted text clipped - 6 lines]
> TextBox to display the quarter that corresponds to the date instead of the full
> date.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.