Change backcolor field in datasheet view

pascal

isolation
Local time
Today, 18:45
Joined
Feb 21, 2002
Messages
62
Hi again,

Is it possible to change the backcolor of a certain field (text field) in a certain record into another color than white when another field in that same record has a particular value and to enable that field then? And this when the form is in datasheet view.

Thanks once again.

Pascal
 
Pascal,

You can do all of that with Conditional Formatting. In Design View
for a field: Format --> Conditional Format

Wayne
 
Hello again,

Thanks Wayne for you reply but I still don't see a way for doing what I want. I'm going to try explain it a little more.

Let's try:

I have a form and a subform.
On the form I only have a field called "Workdate".
After the Workdate has been updated a few records are automatically added in the subform.
The subform is in datasheet view and has 4 fields. Let's name them "field1", "field2", "field3" and "field4".
Field1 has already been given a value (but not always the same value) when a few records were automatically added with the After_Update event of the field "Workdate".
When field1 has a specific value, then I want field2 to be enabled and have a different backcolor than the other fields of that same record. And the focus must go to field3.
The meaning of all this is I want to make it impossible for the user to fill in this field (field2) and to show at first sight (by the different color) that this field isn't available.

I really think this is something that has to be done with code, don't you think.

Anyone who can help me out?

Thanks.

Pascal
 
If you can't do it with conditional formatting, you can't do it. Access only maintains a single set of properties for each control, so using code to alter the appearence of a control, simply alters the appearence of all visible records. You have the ability to disable a control by using the conditional formatting but that still allows the cursor. You can actually lock the control with code and set the color with conditional formatting. Since lock has no visible attribute, you can't "see" that all rows are locked if the field is locked in the current row so it doesn't matter if all rows are locked since you can't actually work with more than one row at a time. Do your formatting in the current event and don't forget you need an action on either side of the If. You can't just lock the field in one condition and not unlock it when that condition is false.
 

Users who are viewing this thread

Back
Top Bottom