I have a grid control in a subform that returns the result of a query that displays the required inventory for a build and the inventory available on hand as two columns. I would like to highlight rows or cells of the grid depending on criteria:
- If Inventory_required > Inventory_available → Highlight Red
- If Inventory_required = Inventory_available → Highlight Yellow
- If Inventory_required < Inventory_available → No Highlight
I’m able to access individual rows in the macro using a while loop but I can’t seem to change the color of a specific row. Is it even possible?
I tried using both of the following lines within IF statements in order to get the color to change, but the attributes aren’t right:
oForm.getByName(“gridPartsCount”).getByName(“txtAvailableParts”).BackgroundColor = RGB(255,0,0) and
oForm.getByName(“gridPartsCount”).getByName(“txtAvailableParts”).TextColor = RGB(255,0,0)
Here is a mockup of what I would like the end result to be (highlighting was done in an image editor)
Is this possible? if so, what parameter do I need to set?
Thanks for the help!
Charles