-
1
- #1
dpatrickcollins
Programmer
- Nov 18, 2002
- 79
Here's a helpful hint that cost me over an hour to figure out.
If you are using VB and Crystal's RDC and are wishing to return the value of a parameter field whose value has already been assigned, either in code or by the user, DO NOT use the VALUE property of the parameter field. It will return blank no matter what you try. This is in contradiction to Crystal's help file which says the VALUE property will return the, er, value.
Use instead the "GetNthCurrentValue()" method of the parameter field.
Sample Code:
*Wrong Way*
With Report
Set pf = .ParameterFields(1)
With pf
.SetCurrentValue "1"
debug.print .Value
End With
End With
*Right Way!*
With Report
Set pf = .ParameterFields(1)
With pf
.SetCurrentValue "1"
debug.print .GetNthCurrentValue(1)
End With
End With
If you are using VB and Crystal's RDC and are wishing to return the value of a parameter field whose value has already been assigned, either in code or by the user, DO NOT use the VALUE property of the parameter field. It will return blank no matter what you try. This is in contradiction to Crystal's help file which says the VALUE property will return the, er, value.
Use instead the "GetNthCurrentValue()" method of the parameter field.
Sample Code:
*Wrong Way*
With Report
Set pf = .ParameterFields(1)
With pf
.SetCurrentValue "1"
debug.print .Value
End With
End With
*Right Way!*
With Report
Set pf = .ParameterFields(1)
With pf
.SetCurrentValue "1"
debug.print .GetNthCurrentValue(1)
End With
End With