Prev: Trying to calculate difference between two times in an access repo
Next: easiest way to create gridlines in an Access 2003 report
From: David McCormack on 6 Jun 2010 14:52 I have tried this but I keep getting an error. This is what I have: =IIf([Operation]=2,Format([May], "##0.0"),Format([May], "##0.0%")) I have a field that if the object [Operation] is equals to 2, I need the field to be in a standard number format with one decimal place. Otherwise I need the field to be in a percentage format with one decimal place. "Duane Hookom" wrote: > You should be able to set a control source like: > =IIf([Jim]<1,Format([Jim],"0.00"),Format([Jim],"0")) > -- > Duane Hookom > Microsoft Access MVP > > > "JASelep" wrote: > > > I have a report that uses one area to display either a percentage or a count > > > > I'd like to format the report field output so that if the value is less than > > 1 to format the number as a 2 decimal point percent and if it is 1 or greater > > format it as an integer > > > > the conditional formatting features I see deal with the conditional display > > format and not the conditional numeric formatting > > > > I've struggled to see if I could conditionally format the data at the > > ControlSource point of the field properties or at the format point but have > > hit deadends on both avenues > > > > Jim-
From: Marshall Barton on 6 Jun 2010 15:11 David McCormack wrote: >I have tried this but I keep getting an error. This is what I have: > >=IIf([Operation]=2,Format([May], "##0.0"),Format([May], "##0.0%")) > >I have a field that if the object [Operation] is equals to 2, I need the >field to be in a standard number format with one decimal place. Otherwise I >need the field to be in a percentage format with one decimal place. I don't see a problem with the expression. If your error is that the text box displays #Error, then try changing the name of the text box to something other than the nae of a field in the report's record source (eg. txtMay). -- Marsh MVP [MS Access]
From: David McCormack on 7 Jun 2010 01:52
Marshall, Thank you for the help. It didn't help out completely, but it got me in the right direction and I was able to get my report to work properly. "Marshall Barton" wrote: > David McCormack wrote: > > >I have tried this but I keep getting an error. This is what I have: > > > >=IIf([Operation]=2,Format([May], "##0.0"),Format([May], "##0.0%")) > > > >I have a field that if the object [Operation] is equals to 2, I need the > >field to be in a standard number format with one decimal place. Otherwise I > >need the field to be in a percentage format with one decimal place. > > > I don't see a problem with the expression. If your error is > that the text box displays #Error, then try changing the > name of the text box to something other than the nae of a > field in the report's record source (eg. txtMay). > > -- > Marsh > MVP [MS Access] > . > |