Results 1 to 5 of 5
  1. #1
    DBS1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2020
    Posts
    47

    Conditional Formatting doesn't pass to next group

    Good morning,


    I have a report that tracks weekly inventory for vendors. The report is pulling from qryWeeklyInventory. The fields in the query are Vendor, Day, and AmtOnHand. I have the report grouped by Vendor, and have a conditional format to color code the Vendor field blue for amounts over 35. The rule I have created is "Expression is ([AmtOnHand])>=35" (quotation marks are not part of the equation, just to hightlight what the expression is). This works fine for the first Vendor that has 35 on hand, but doesn't pass it on to the next Vendor. I have moved the Vendor box out of the Vendor group header and into the detail section as a test, and it then passes the rule on to the other vendors. It looks as if the conditional formatting isn't passing on to the next group. How would I go about fixing this?

  2. #2
    DBS1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2020
    Posts
    47
    Upon further investigation, I find that the problem isn't what I thought it was, but that the expression is only looking at the first record for each vendor, and if it doesn't meet the criteria, moves on to the next vendor. I need the expression to look at the AmtOnHand for the vendor, on either one of the 7 records (day 1 through day 7) and return a result based on a match of the criteria with any of those records.

  3. #3
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,158
    If you can, depending on how our data is stored and queried, include a Max([AmtOnHand]) in the vendor header and use that as you CF trigger.

    You may need to use a sub query to get it into your normal query results.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    You might want to create a new totals query grouping by Vendor and getting Max(AmtOnHand) for the week; then bring that query into the report's record source by joining on Vender(ID) and use that field for the conditional formatting.

    EDIT: Minty beat me to it...
    You can also try to use a DMax("
    AmtOnHand","qryWeeklyInventory","VendorID =" & [VendorID])
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    DBS1 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2020
    Posts
    47
    That did it. Thanks Minty and Vlad. Much appreciated.

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

Similar Threads

  1. Replies: 3
    Last Post: 02-24-2017, 03:58 PM
  2. Replies: 2
    Last Post: 11-12-2015, 10:46 AM
  3. Conditional formatting on group header
    By jmk0576 in forum Reports
    Replies: 11
    Last Post: 10-16-2015, 02:50 PM
  4. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  5. option group pass different value to same listbox
    By ice051505 in forum Programming
    Replies: 11
    Last Post: 03-12-2013, 11:52 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