Results 1 to 7 of 7
  1. #1
    mmart33 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    23

    New field value from large table column to be highlighted in report

    Hello All,

    I have a daily report that shows data from previous day for production. When we have new products produced, I would like a field to be highlighted if it is the first time it has come up. I do not want it a unique field just from yesterday, but to analyze the table of all of the production days and highlight if a particular field from a column is unique.



    Can this be done?

    Thanks!!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    What is there to indicate this product is New? Once an item is in the table, it looks like all other items (new or old)
    what defines new?

  3. #3
    mmart33 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    23
    I am not sure if I need to declare it as "new". What I mean is if I have several products produced over a period of time and my column field looks like this:
    Date-Product
    9/1 -A1
    9/2 -A1
    9/2 -A2
    9/2 -A2
    9/3 -A2
    9/3 -A1
    9/3 -A3

    When I run my report on 9/3, I would like A3 in the report to be highlighted since it was the first time it was entered in the table. Make sense? Maybe somehow create a query to analyze the table for "FIRST" and if that record is called, any "FIRST" items from a field is highlighted?

    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    But you don't want the first A1 and A2 to be highlighted? You want an Ax value highlighted if it is the only one?

    A subquery that does a count of the Ax values might provide the info needed in the report RecordSource. A DCount() domain aggregate function could also. Then Conditional Formatting could use the count as criteria for highlighting textbox.
    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.

  5. #5
    mmart33 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    23
    Well if I pulled the record on just 9/1, I would want the A1 to be highlighted. If I pull the report on 9/3, I would only want the A3 to be highlighted since we had never produced it before and no field has had that value before that date.

    Make sense? Does someone have example coding I could use?

    Thanks again!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    This is a very unique requirement and I expect will require some creative coding. You say this data is all in one field - the date and Ax values should be in separate fields. If the report has the Ax as a grouping criteria, could maybe to a Count() calc in textbox and Conditional Formatting could use that.

    What if you run the report on 9/3 and there is only one A1 record and one A3 record - should both be highlighted?
    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.

  7. #7
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    June7's first suggestion of using a subquery or the DCount() function should work for what you want. If you want to be able to reprint a report from a previous date and have it highlight items correctly though, you will need to be sure and include the report date as part of the subquery or DCount() criteria.

    Using DCount():
    Code:
    DCount("[Product]", "MyTable", "[Date]<=" & Me!ReportDate)
    Then you can just use Conditional Formatting to highlight any rows where this returns exactly 1.
    Last edited by Rawb; 09-03-2015 at 01:27 PM. Reason: Hooray for typos!

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

Similar Threads

  1. Replies: 5
    Last Post: 12-07-2014, 01:15 PM
  2. Replies: 2
    Last Post: 10-29-2013, 04:38 PM
  3. Exporting to Excel - All Worksheets Highlighted
    By kristyspdx in forum Import/Export Data
    Replies: 3
    Last Post: 02-26-2013, 05:42 PM
  4. Replies: 1
    Last Post: 01-10-2012, 12:06 AM
  5. Replies: 1
    Last Post: 02-26-2009, 11:31 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