Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012
    Posts
    24

    Unanswered: Reports - calculating a calculated textbox?

    Hi,

    Each time my report runs the user is prompted to key 3 separate values which are then displayed on the detail section of the report.

    OcRoutedALL
    VcRoutedALL
    IbRoutedALL

    Ideally I would like the report to also Sum those 3x values and display the total on the report, but I am having no luck achieving this

    At the moment if I key:-
    1
    2
    3

    The total textbox (TotalRoutedALL) shows:
    123 instead of 6

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    You need to make the Access Gnomes understand that

    OcRoutedALL
    VcRoutedALL
    IbRoutedALL


    are Numeric. The answer of 123 indicates that they think that these are Text or Alpha Characters. I'm fuzzy as to exactly where the above Fields are being entered and whether or not they're Bound or Unbound.

    If Bound, simply set the Datatypes of the Fields to Number.

    If Unbound, Format the Textboxes as Numbers.

    Alternately, you could change your calculation to something like

    CInt(OcRoutedALL) + CInt(VcRoutedALL) + CInt(IbRoutedALL)

    for Integers or

    CDbl(OcRoutedALL) + CDbl(VcRoutedALL) + CDbl(IbRoutedALL)

    for Numbers that contain decimals.

    Linq ;0)>
    Last edited by Missinglinq; 10-08-13 at 20:39.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    May 2012
    Posts
    24
    Sorry, i should've said they were Unbound textboxes.

    I already tried changing the format of the textboxes to General Number but it didn't make a difference, however thanks to you i've got it working now via CInt

    Many Thanks!

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    how are you populating these unbound text boxes?
    what you cant do in an Access report is aggregate a group of aggregated controls (you can't sum a series of control whose datasource is a sum of soemthing else

    either set the controls source to be the same as the grouped aggregate control or do the maths yourself behind the scene unsing code in the reports on format event.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •