Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 + Crystal Reports 8.0 - Setting date range parameter

Status
Not open for further replies.

emallon

Programmer
Jul 6, 2000
31
0
0
US
I am trying to set a date range parameter in a Crystal report from my VB6 application. I have never done this before. All previous setting of parameters were single value. Can someone shed some light on the approach?

here is sample code of what I am current doing to set parameter values:

Set crParameterFields = crReport.ParameterFields
For Each crParameterField In crParameterFields
With crParameterField
Select Case .ParameterFieldName
Case "Fiscal Year"
.SetCurrentValue (strYear)
Case "Period"
.SetCurrentValue (intPeriod)
Case "Currency"
.SetCurrentValue ("USD")
End Select
End With
Next
 
emallon,

Here is a sample from one of my applications, perhaps it will help. In this example I am using a DSR named CrystalReport1, and two date pickers in VB6

With CrystalReport1
'Set Crystal parameter for Report Date Range
.ParameterFields(1).AddCurrentRange _
dteDatePicker(1).Value, dteDatePicker(0).Value, _
crRangeIncludeLowerBound + _
crRangeIncludeUpperBound
End With

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top