Discussion Locked

Access Change Text Clr Current Record

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am trying to get the text color of a new record to change when the status of the inventory is 2 (indicating it is low). Problem is this is in a subfor and it my code changes the color for all the controls and not "Just" the one line.

5 replies

by kees.valkenswaard

You should use conditional format. Just set the condition to your value and that is it. The idea is the same as in Excel. It works in a form and in reports. The condition would be "field is" or "expression".
Suppose that in your case the item name is in field ItemName and the quantity in the inventory in field InvQuant
For the field ItemName the conditional format [under menu choice format] would be:
Expression: [InvQuant] <= 2
For the field InvQuant itself:
Field: smaller or equal to: 2
You can specify Bold, Italics, Underlined, text colour, background colour.
The only disadvantage is that it may slow down your forms.
Good luck

NOTE this works for Access 2000 and up.

by fernstar

When you set the parameters for a multi line grid in Access you do exactly that, you set them for the entire grid, not a specific row.
I have been unable to find a way of colouring a single row or a single cell on an access grid.
In VB (which does not provide any serious multi line screen capabilities) you can purchase third party products like VSFelxgrid which will allow you to colour anything you like. Th amount of code required to get one of these grids up and running properly however is triple anything you will do in Access.
In short, forget the colour and enjoy all the other great features of Access that save you time and effort.

This discussion is closed to new replies.