View Single Post
  #3  
Old January 8th, 2010, 01:06 PM posted to microsoft.public.access.reports
Dale Fye
external usenet poster
 
Posts: 2,651
Default Variable/Adaptive Numeric Format

If you can define the logic for "significant details", then you can use the
Detail sections Format event. Something like:

Private Sub Detail_Format

if abs(val(NZ(me.txtQuantity, 0)) - int(val(NZ(me.txtQuantity, 0))))
..005 Then
me.txtQuantity.Format = "#"
else
me.txtQuantity.Format = "#.00"
endif

End Sub

--
----
HTH
Dale



"JASelep" wrote:

in Access 2007
I some report fields that are to display quantities and amounts
the range of these numbers could be large (100,000 or $345,999) or small
(0.375 or $0.0625)
is there a way to have the field formatted to adapt to the range of the
value being displayed
for example if the value has no significant decimals then display the value
without decimal places (512.00 becomes 512) or if the value has many decimals
limit the display to only 2 decimals (0.63712938 becomes 0.64)


--
Jim