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!

Prompting for a Field name

Status
Not open for further replies.

sopomeres

MIS
Jan 16, 2003
61
US
Is there a way in CR to set up a prompt or parameter for a particular field name.

For instance, in a table called 'attend' have fields named 'd001' up to 'd175'. I want to display the data for a field that will be selected by the user.

Should I use a formula for this??? How?

attend
======
d001
d002
etc

-Chuck
 
So you literally mean that d001 to d175 are different fields within a table called "attend" so that each field is named something like {attend.d001}, {attend.d002}, attend.d003}, etc., and you want to allow 175 choices for the parameter?

I think you'd have to create a parameter {?whichfield} and manually enter each field name (or its description, like "Name") as a default parameter value. Or, if the users are familiar with the available fields, allow them to manually enter the field themselves.

Assuming you want only one field displayed at a time, you can create a formula like the following and place this in the details section of your report:

select {?Whichfield}
case "Name" : {Customer.Customer Name}
case "Date" : totext({Orders.Order Date})
case "Amount" : totext({Orders.Order Amount},0,"")
default : ""

...where the parameter options are before the colon and the respective field name is after the colon. Note that the fields after the colon must be converted so that they are of the same (string) datatype, and that I have set up the discrete parameter as a string.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top