Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 19th, 2003, 09:40 AM
lambda75 lambda75 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Orlando, fl
Posts: 8 lambda75 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
fiscal year format

I work for a company that has a fiscal year calendar like the public schools.
I would like to have my forms in Access go on a fiscal year calendar. Is there any way that access will let me change the date format so that November of 2003 is recognized as the new fiscal year of 2003-2004.

Any help will be appreciated.

Reply With Quote
  #2  
Old December 19th, 2003, 11:20 AM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 281 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 16 m 17 sec
Reputation Power: 7
Just copy the following function into a new module and then call the function fiscalyear(anydate,"FY","Begin") to get Fiscal year begin date nad fiscalyear(anydate,"CY","Begin") to get Calendar year begin date.

Public Function FiscalYear(InDate As Date, FYorCY As String, BeginOrEnd As String) As Date
'Assumption your date setting in regional settings in control panel is yy/mm/dd
'Sample Usage-------
'CY - Calendar Year
'FY - Fiscal Year
'FiscalYear(Date(),"Begin") returns 01/01/03
'FiscalYear(Date(),"FY","Begin") returns 01/11/03
'FiscalYear(Date(),"CY","End") returns 31/12/03
'FiscalYear(Date(),"FY","End") returns 31/10/03
Dim InMonth As Integer
InMonth = Month(InDate)
Select Case FYorCY
Case Is = "CY"
If BeginOrEnd = "Begin" Then
FiscalYear = CVDate("01/01/" & Str(Year(InDate)))
Else
FiscalYear = CVDate("12/31/" & Str(Year(InDate)))
End If
Case Is = "FY"
Select Case BeginOrEnd
Case Is = "Begin"
If Month(InDate) < 11 Then
FiscalYear = CVDate("11/01/" & Str(Year(InDate)) - 1)
Else
FiscalYear = CVDate("11/01/" & Str(Year(InDate)))
End If
Case Is = "End"
If Month(InDate) < 11 Then
FiscalYear = CVDate("10/31/" & Str(Year(InDate) + 1) - 1)
Else
FiscalYear = CVDate("10/31/" & Str(Year(InDate) + 1))
End If
End Select
End Select

End Function
__________________
V.Subramanian

Reply With Quote
  #3  
Old December 31st, 2003, 05:47 PM
Brian R Brian R is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: New Jersey
Posts: 3 Brian R User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
supersubra...
I have a need to establish Calendar and Fiscal dates also and set start and end dates as parameters for reports, etc.. My question is, what does your code do for me. Forgive my ignorance, I’m a fairly new user. This is the first time I have used the Forum. It's a little daunting.
Thanks
B. Ray

Reply With Quote
  #4  
Old July 23rd, 2009, 11:25 PM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 281 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 16 m 17 sec
Reputation Power: 7
Suppose you want to prefix (defaulting the values) the date to calendar year begin and end in text boxes for from and to fields in the selector form of a report
all you have to do is

Paste the following code into form open event of any form that you are going to use for opening the report.
//Code begin
forms!formname!fromdate = FiscalYear(Date(), "CY", "Begin") As Date
forms!formname!todate = FiscalYear(Date(), "CY", "End") As Date
//Code end
formname = Name of the selector form
fromdate = Name of the textbox holding starting date
todate = Name of the textbox holding end date.



Before achieving this you have to copy the entire function in a separate module.

For any clarification you can call me back.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > fiscal year format


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek