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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Field Value Property Blank Even after Assigned 1

Status
Not open for further replies.

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top