I got another problem while working on this database for the Univ.
The Form.viewreports has several radial button options so that the user can
view a Report for several periods--like a day, a week, a month, etc. The frame is linked to a select case statement.
The user is also able to choose the radial button options: "fiscal year" and "fiscal year-to-date" reports. The fiscal year for the univ. starts on July 1st.
The Query that sends the data to the Report for a user to view has two parameters called "bgndate" and "enddate" which are both linked to fields on the Forms![viewreport] which I am currently working.
So, Forms![viewreports]![bgndate] and Forms![viewreports]![enddate] are available for the user to define.
Question: How in the heck, do I set the [bgndate] on the Form![viewreport]
to the beginning of the fiscal year -- July 1st (current year)
--shiznaw
3 2053
If you're asking how to set add the current year to July1, then something like this should work:
bgndate = "07/01/" & datepart("yyyy",Date)
I think I got it: How to establish the Fiscal Year-to-Date Parameter in VBA
Dim fscldate as Variant
----------------------------------------------------------------------------------------
If Date < Format("08/01/" & Year(Now)) Then
fscldate = Format("08/01/" & Year(Now) - 1)
Else
fscldate = Format("08/01/" & Year(Now) - 1)
End If
----------------------------------------------------------------------------------------
[reprtform]![Beginning] = fscldate
[reprtform]![ending] = DateSerial(Year(Now()), Month(Now()), Day(Now()))
msgbox ("From Date: " & [Beginning] & " " & "To Date: " & [ending])
the above works. Please critique
thanxs
shiznaw, scripts village idiot
I think I got it: How to establish the Fiscal Year-to-Date Parameter in VBA
Dim fscldate as Variant
----------------------------------------------------------------------------------------
If Date < Format("08/01/" & Year(Now)) Then
fscldate = Format("08/01/" & Year(Now) - 1)
Else
fscldate = Format("08/01/" & Year(Now) - 1)
End If
----------------------------------------------------------------------------------------
[reprtform]![Beginning] = fscldate
[reprtform]![ending] = DateSerial(Year(Now()), Month(Now()), Day(Now()))
msgbox ("From Date: " & [Beginning] & " " & "To Date: " & [ending])
the above works. Please critique
thanxs
shiznaw, scripts village idiot
Nice!
But of course not the only way.
Here is my solution.
=DateSerial(Year(DateAdd("m", -7, [YourDate])), 8, 1)
How do you like it?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Dana Shields |
last post by:
I am attempting to upsize from access to SQL Server. I'm trying to convert
my queries to SQL Server views; however, I'm having a lot of difficulty with
the syntax differences.
For instance, a...
|
by: Neil |
last post by:
I have been coding with ASP for some time now. I am using an ACCESS
database. I am in the UK and wish to use DD/MM/YYYY format for dates.
I have had no end of problems and possible solutions to...
|
by: StBond |
last post by:
Hi everyone,
I am new to Access and Visual Basic so things my be getting across a
bit cloudy. I only started using VB for one week.
I am having a little problem with the database that I am...
|
by: Mell via AccessMonster.com |
last post by:
Is there a way to find out where an application was created from?
i.e. - work or home
i.e. - if application sits on a (work) server/network, the IT people know the
application is sitting...
|
by: Henning M |
last post by:
Hi all,
I having some problems with Access and selecting records between dates..
When I try this in access, it works fine!!
"Select * from Bilag Where Mdates Between #1/1/2006# And...
|
by: Easystart |
last post by:
Hi,
Sorry for my English. English is not my native tougue.
I am working in MS Access 2000 with a SQLServer 2000 Backend database.
MS Access 2000 is my GUI front end that has SQLServer linked...
|
by: hardik |
last post by:
hi friends,
i am really surprized the way access behaves in date fields i mean
it's all ok when you have us time zone or us servers but if you have
diffrent timezone like uk then access creates...
|
by: RMC |
last post by:
Hello,
I'm looking for a way to parse/format a memo field within a report.
The Access 2000 database (application) has an equipment table that
holds a memo field. Within the report, the memo...
|
by: smaczylo |
last post by:
Hello, I've recently been asked to work with Microsoft Access, and
while I feel quite comfortable with Excel, I'm at a complete loss with
databases. If someone could help me with this issue I'm...
|
by: colmkav |
last post by:
Hi, can someone tell me how I change the settings in my Access 97 to
default to English dates rather than US dates?
I notice all my dates like 1/5/2007 is being treated as 5th Jan 2007
rather...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |