Re: Annoying decimal point

From: John Nurick (j.mapSoN.nurick_at_dial.pipex.com)
Date: 03/16/04


Date: Tue, 16 Mar 2004 07:34:14 +0000

Hi Bruce,

Try using an expression in the textbox on the report, something along
the lines of

=IIF(Abs(X-Int(X))>=0.005,Format(X,"#.##"),Format(X,"#0"))

replacing X with [FieldName]

On Mon, 15 Mar 2004 12:35:58 -0800, "Bruce"
<anonymous@discussions.microsoft.com> wrote:

>I have a report containing a sum. Sometimes the sum is a
>whole number, sometimes it has one decimal place, and
>sometimes two. The number format #.## does what I want
>except that it keeps the decimal point for a whole number
>(i.e. 3.). Is there a way of supressing the decimal point
>if the result is a whole number? I can sort of imagine
>that an IIf statement could take care of it, but I'm not
>sure how to put that together or where to put it. A minor
>issue, but it keeps cropping up.

--
John Nurick [Microsoft Access MVP]
Please respond in the newgroup and not by email.


Relevant Pages

  • RE: Color Code Records In A Report
    ... Create a new query. ... Click on View> Sorting and Grouping in report design. ... Drag the OrderDate field from the Field List, and drop it into the OrderDate ... Rename the CompanyName textbox to txtCompanyName ...
    (microsoft.public.access.gettingstarted)
  • Re: Report Group Footer not displaying the total that I want
    ... One option is to use the built in running sum property (data tab) of a ... textbox when it is on a report. ... I have a report based on the following query (hang in there ... > tblTrials.eventID) INNER JOIN (((tblPeople INNER JOIN tblJudges ON ...
    (comp.databases.ms-access)
  • Re: Reports!StandardInvoice!BIType="Invoice" - not executing as ex
    ... convert the control on your report to a Label (easier to work with this ... as a textbox, but you would need to do something like this: ... in the code of a button's Click event procedure. ...
    (microsoft.public.access.formscoding)
  • RE: Conditional sum
    ... Sorry Jeannie, I was busey Friday PM and than enjoyed the weekend with the ... I assume the data source contains a field "payments" and a field named ... Now in an unbound field in your report you type: ... This gives you the data for the Credit textbox. ...
    (microsoft.public.access.reports)
  • Re: Colour Control
    ... NEW - Jan. 28/2000 The Font and Color Dialogs are very easy to call. ... ' Pass the TextBox Control to the function ... > when you open it or have the report retrieve these color numbers from ... >> One button that opens a colour selection popup to set the ...
    (microsoft.public.access.formscoding)