S
Steve
Hi,
Have a report that I would like to count 2 different parameters, both date
fields within a given date range. I can get it to work for one parameter but
when adding the second with an eithe AND, or OR neither work.
would appreciate your help.
Thanks,
Private Sub cmd_UrFasttrack_Click()
On Error GoTo Err_cmd_UrFasttrack_Click
Dim stDocName As String
Dim stCriterion As String
Dim stStartDate As Date
Dim stEndDate As Date
stCriterion = ""
If IsNull(Forms!frmRptsbyDate!StartDate) Then
MsgBox "No Start Date, using All Dates"
GoTo Print_Report
End If
stStartDate = Forms!frmRptsbyDate!StartDate
If IsNull(Forms!frmRptsbyDate!EndDate) Then
MsgBox "No End Date, using All Dates"
GoTo Print_Report
End If
stEndDate = Forms!frmRptsbyDate!EndDate
stCriterion = "(RequestDate between #" & stStartDate & "# AND #" &
stEndDate & "#)" And stCriterion = "(FastTrack between #" & stStartDate & "#
AND #" & stEndDate & "#)"
stDocName = "rptURandFastTrack2"
DoCmd.OpenReport stDocName, acPreview, , stCriterion
Print_Report:
stDocName = "rptURandFastTrack2"
DoCmd.OpenReport stDocName, acPreview, , stCriterion
Exit_cmd_UrFasttrack_Click:
Exit Sub
Have a report that I would like to count 2 different parameters, both date
fields within a given date range. I can get it to work for one parameter but
when adding the second with an eithe AND, or OR neither work.
would appreciate your help.
Thanks,
Private Sub cmd_UrFasttrack_Click()
On Error GoTo Err_cmd_UrFasttrack_Click
Dim stDocName As String
Dim stCriterion As String
Dim stStartDate As Date
Dim stEndDate As Date
stCriterion = ""
If IsNull(Forms!frmRptsbyDate!StartDate) Then
MsgBox "No Start Date, using All Dates"
GoTo Print_Report
End If
stStartDate = Forms!frmRptsbyDate!StartDate
If IsNull(Forms!frmRptsbyDate!EndDate) Then
MsgBox "No End Date, using All Dates"
GoTo Print_Report
End If
stEndDate = Forms!frmRptsbyDate!EndDate
stCriterion = "(RequestDate between #" & stStartDate & "# AND #" &
stEndDate & "#)" And stCriterion = "(FastTrack between #" & stStartDate & "#
AND #" & stEndDate & "#)"
stDocName = "rptURandFastTrack2"
DoCmd.OpenReport stDocName, acPreview, , stCriterion
Print_Report:
stDocName = "rptURandFastTrack2"
DoCmd.OpenReport stDocName, acPreview, , stCriterion
Exit_cmd_UrFasttrack_Click:
Exit Sub