Kamis, 10 Mei 2012

[MS_AccessPros] Re: Display rank name in report rather than value in report

 

Amy,
I would never hard-code the ranges into any type of expression in a record source query or control source. I ALWAYS assume the definitions of low, medium, and high are going to change and I would hate to have to find all the expressions where I had numbers hard-coded.

Minimally create a function that accepts the value and returns "Low", "Medium", or "High". Save the function in a module named "modBusinessCalcs".

Ideally you should have a table with the min and max values as well as the "label". You can then maintain data, not code.

Since you will be maintaining the application, you can do as you please ;-)

Duane Hookom
MS Access MVP

--- In MS_Access_Professionals@yahoogroups.com, "Amy" <jaacmmason@...> wrote:
>
> I have a table in which 3 columns are calculated based on other columns in same table. I also have a report based off of this one table. The problem I am having is not being able to display the proper data in my report.
>
> I want the report to show a Low, Medium, or High when viewed rather than the number value which is already in the field in table. So if a table field has a calculated value of 4 in it, then I want the report to show a Low, whereas if field has a calculated value of 7 then it would be rated as a Medium. The values of 1-6 should show as Low, 7-9 as Medium and values of 10-12 I would like to be displayed as high. Is this possible within the report itself?
>
> I am not sure if I need to start looking at a event to make this happen, or if I need to redo the entire report for this to happen or what. I can tell you the table being used to create report holds data based out of other tables. Does this change need to be made at the table level? I want the table to display the value of the calculated field, while just having the report display the ranking. I hope this makes some sort of sense.
>
> Thank you in advance for any hint, assistance, and/or help anyone can offer to me.
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar