Conditional Formatting in Datasheet Form

jsmith1611

Registered User.
Local time
Today, 05:33
Joined
Jan 7, 2009
Messages
23
I am trying to conditionally format the foreColor and backColor of several fields in a datasheet based on a combo box which has 2 values. I would like to have the entire row change colors if the combo box has a "Y" selected and vice versa.

I can get the formatting to work, however, the backColor for the field in every row is changed when I change the value of the combo box. I would like only the row that the combo box is in be updated. Can I do this with a datasheet?

Thanks,

Joshua Smith
 
I am trying to conditionally format the foreColor and backColor of several fields in a datasheet based on a combo box which has 2 values. I would like to have the entire row change colors if the combo box has a "Y" selected and vice versa.

I can get the formatting to work, however, the backColor for the field in every row is changed when I change the value of the combo box. I would like only the row that the combo box is in be updated. Can I do this with a datasheet?

Thanks,

Joshua Smith
Yes, you can do it but use the CONDITIONAL FORMATTING from the FORMAT menu and not through VBA.
 
Bob, thanks for the reply. I have tried the conditional formatting from the format menu, but it doesn't seem to allow you to determine the formatting by the value of another field. When I select a value of "Y" from the combo box in the row, I want all of the fields (in that row) to be formatted differently.

When I tried this programmatically, the field formatting was applied to the particular field in every row. I was applying the formatting on the after_update of the combo box.

Private Sub full_AfterUpdate()
If Me.full = "Y" Then
group.backColor = vbRed
Else
group.backColor = vbWhite
End If
End Sub
 
Bob, thanks for the reply. I have tried the conditional formatting from the format menu, but it doesn't seem to allow you to determine the formatting by the value of another field.

All you need to do is change VALUE IS to EXPRESSION IS and then put in your [FieldName]="Whatever"
 
Bob, you are the greatest! Who knew the solution would be so easy. It would be nice to find an Access book that covered everything....any suggestions?
 

Users who are viewing this thread

Back
Top Bottom