Results 1 to 3 of 3
  1. #1
    MichealShinn is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    24

    Can I highlight the line a median value is on?

    Dear Experts,

    I'm working on a report that has a formula to figure out the median value for a group of records. It looks like this:

    Facility Name Group Header

    Facility Name field value



    Facility 1 Value 1
    Facility 2 Value 2
    Facility 3 Value 3

    Facility Name Group Footer

    Median value for field: Value 2

    The people who have been doing this have all the records on a spreadsheet, and they go through it and manually figure out which record has the median value and they've been highlighting that record in yellow. Is there any way I can have Access go back and highlight record 2 after it figures out that Record 2 has the median value?

    Thank you for all your help.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,892
    Maybe, but would certainly require VBA code to accomplish, if possible. I suspect will require a custom function that compares the value of current record to values of related records and sets BackColor property. VBA and SQL do not have an intrinsic median function. Review http://www.sqlmag.com/article/tsql3/...ql-server-2005.

    Also, Access tables, forms, and reports don't have 'lines' they have 'fields' and 'controls' - textboxes, comboboxes, labels, etc. The highlight setting would have to be applied to each field or control. Code could be applied to forms and reports but not tables.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    What line would they highlight in the following list where the median value does not exist:

    Facility 1 Value 1
    Facility 2 Value 2
    Facility 3 Value 3
    Facility 3 Value 3
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Finding the Median when in a grouped Query
    By jamesborne in forum Queries
    Replies: 4
    Last Post: 02-22-2012, 08:24 PM
  2. Median Calculations and Group By
    By jlandis in forum Queries
    Replies: 4
    Last Post: 02-22-2011, 11:15 PM
  3. Median value for multiple columns
    By MIS_Analist in forum Queries
    Replies: 2
    Last Post: 10-08-2010, 11:14 AM
  4. Finding Median in Query
    By randolphoralph in forum Queries
    Replies: 1
    Last Post: 02-19-2010, 11:18 AM
  5. Median and Mode for a large table
    By brandon in forum Access
    Replies: 0
    Last Post: 05-08-2008, 09:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums