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, 10: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, 12:20 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
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, 06: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 24th, 2009, 12:25 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
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!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT