i got date parameter but it shows only 2007 records and not for other
year and would like to know where i have writte code wrong it shows
month only from 1/3/2007 to 2/4/2007 not able to figureout y.
Option Compare Database
Private Sub cmdMonth_Click()
Public Function fncFirstofMonth(dtmDate As Date) As Date
Dim dtmResult As Date
fncFirstofMonth = DateSerial(Year(dtmDate), Month(dtmDate), 1)
End Sub
Public Function fncLastofMonth(dtmDate As Date) As Date
Dim dtmResult As Date
dtmResult = fncFirstofMonth(dtmDate)
dtmResult = DateAdd("d", -1, DateAdd("m", 1, dtmResult))
fncLastofMonth = dtmResult
End Sub
Private Sub cmdtoday_Click()
'sets the Date From and Date To text boxes
'to Today's Date
Me!txtDateFrom = Date
Me!txtDateTo = Date
End Sub
Private Sub cmdweek_Click()
'sets the Date From and Date To text boxes
'to show complete working week (mon - fri)
Dim today
today = Weekday(Date)
Me!txtDateFrom = DateAdd("d", (today * -1) + 2, Date)
Me!txtDateTo = DateAdd("d", 6 - today, Date)
End Sub
Private Sub cmdyear_Click()
'Sets the Date From and Date To text boxes
'to show complete current year
Me!txtDateFrom = CDate("01/01/" & Year(Date))
Me!txtDateTo = DateAdd("d", -1, DateAdd("yyyy", 1, Me!
txtDateFrom))
End Sub
Private Sub cmdReport_Click()
On Error GoTo Err_cmdReport_Click
Dim stDocName As String
stDocName = "rptDateParameterReport"
'Check values are entered into Date From and Date To text boxes
'if so run report or cancel request
If Len(Me.txtDateFrom & vbNullString) = 0 Or Len(Me.txtDateTo &
vbNullString) = 0 Then
MsgBox "Please ensure that a report date range is entered into
the form", _
vbInformation, "Required Data..."
Exit Sub
Else
DoCmd.OpenReport stDocName, acPreview
End If
Exit_cmdReport_Click:
Exit Sub
Err_cmdReport_Click:
MsgBox Err.Description
Resume Exit_cmdReport_Click
End Sub 1 2452
On Apr 12, 7:43 pm, bhav...@gmail.com wrote:
i got date parameter but it shows only 2007 records and not for other
year and would like to know where i have writte code wrong it shows
month only from 1/3/2007 to 2/4/2007 not able to figureout y.
Option Compare Database
Private Sub cmdMonth_Click()
Public Function fncFirstofMonth(dtmDate As Date) As Date
Dim dtmResult As Date
fncFirstofMonth = DateSerial(Year(dtmDate), Month(dtmDate), 1)
End Sub
Public Function fncLastofMonth(dtmDate As Date) As Date
Dim dtmResult As Date
dtmResult = fncFirstofMonth(dtmDate)
dtmResult = DateAdd("d", -1, DateAdd("m", 1, dtmResult))
fncLastofMonth = dtmResult
End Sub
Private Sub cmdtoday_Click()
'sets the Date From and Date To text boxes
'to Today's Date
Me!txtDateFrom = Date
Me!txtDateTo = Date
End Sub
Private Sub cmdweek_Click()
'sets the Date From and Date To text boxes
'to show complete working week (mon - fri)
Dim today
today = Weekday(Date)
Me!txtDateFrom = DateAdd("d", (today * -1) + 2, Date)
Me!txtDateTo = DateAdd("d", 6 - today, Date)
End Sub
Private Sub cmdyear_Click()
'Sets the Date From and Date To text boxes
'to show complete current year
Me!txtDateFrom = CDate("01/01/" & Year(Date))
Me!txtDateTo = DateAdd("d", -1, DateAdd("yyyy", 1, Me!
txtDateFrom))
End Sub
Private Sub cmdReport_Click()
On Error GoTo Err_cmdReport_Click
Dim stDocName As String
stDocName = "rptDateParameterReport"
'Check values are entered into Date From and Date To text boxes
'if so run report or cancel request
If Len(Me.txtDateFrom & vbNullString) = 0 Or Len(Me.txtDateTo &
vbNullString) = 0 Then
MsgBox "Please ensure that a report date range is entered into
the form", _
vbInformation, "Required Data..."
Exit Sub
Else
DoCmd.OpenReport stDocName, acPreview
Exit_cmdReport_Click:
Exit Sub
Err_cmdReport_Click:
MsgBox Err.Description
Resume Exit_cmdReport_Click
End Sub
I figured out the erroe sorry for wasting your time This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dominique Javet |
last post by:
Hello,
I'm new to php and mysql and I use Dreamweaver MX 2004, so sorry for this
"newbie" question... I've found no answer in the forum ...
I've a date problem with my formular. In my mysql DB...
|
by: Tony |
last post by:
Hey guys,
I use Google Groups quite a bit as it is an enormous wealth of
information, and now I need some help. I have created a query using
parameters to capture a range of date, the date is...
|
by: John Morgan |
last post by:
Does anyone know what parameter should be used instead of Date = 0 for the
optional parameter in the following function?
Public Function dhAge(ByVal dtmBD As Date, Optional ByVal dtmDate As Date...
|
by: Lauren Quantrell |
last post by:
I already figured out (the hard way) I need to convert all my date
parameters into USA format before executing my stored procedures where
dates are used as parameters.
(Format(StartDate, "m/d/yyyy...
|
by: Rob Meade |
last post by:
Hi all,
Ok - I've come from a 1.1 background - and previously I've never had any
problem with doing this:
Response.Write (Session("MyDate").ToString("dd/MM/yyyy"))
So, I might get this for...
|
by: sixdeuce62 |
last post by:
Hello,
I am trying to create a query that will prompt me to enter the
parameter value if beginning date and ending date.
I have created everything I need in the query, but I have to manually
go...
|
by: =?Utf-8?B?U3R1?= |
last post by:
I have a ASP.NET Ajax app (using client library) calling ASP.NET Ajax-enabled
web services. We are making use of the javascript proxies generated by
ASP.NET Ajax.
The problem we have is that the...
|
by: davide507 |
last post by:
Hello,
I've created a select query with a date range parameter as well as a text field parameter
Between and
The second parameter:
Like or Like Is Null.
When you run the query, and...
|
by: jans78 |
last post by:
Appreciate if you all can help me to solve my Crystal Report problems
First, I create some parameters and one of the parameters is Date. I set the parameter for the date is String.
For example :...
|
by: Kerryn |
last post by:
Hi all new to this site so looking for some help.
I am working in Access 2002, using a select query. I am trying to use a date range parameter to allow the users to end the start date and end...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |