Conditional Formatting of Controls in a subform

A

aross

Hi Folks

My clients app has a booking form (frmBookingEdit), with a subform showing
the names of all people on the booking (frmCabinAllocationSF).
As part of the main form, there is a combo box (cboBookingCust) showing the
name of the "Booking Customer", who is the person to whom correspondence is
sent. The rowsource for the combo box includes the customer's ID, which is
the bound control.
The subform is presented as a datasheet, and includes the customers Ids and
names.
I am trying to use conditional formatting to have the booking customer's
name highlighted in red in the subform.
I tried setting the conditional format for the name control on the subform
as follows

Condition1
Expression is
Forms!frmBookingEdit!frmCabinAllocationSF.Controls("CustomerRef")=Forms!frmBookingEdit!cboBookingCust

and then choosing to have the forecolor in red.

Its not working.

Can anyone tell me where I am going wrong?

Many thanks.

Arthur Ross
 
W

Wayne Morgan

Are you doing this by right clicking the control on the subform and choosing
Conditional Formatting? If so, try this expression:

[CustomerRef]=[Parent]![cboBookingCust]
 
A

aross

Thanks for the reply Wayne

It worked.

Arthur Ross


Wayne Morgan said:
Are you doing this by right clicking the control on the subform and choosing




Conditional Formatting? If so, try this expression:

[CustomerRef]=[Parent]![cboBookingCust]

--
Wayne Morgan
MS Access MVP


aross said:
Hi Folks

My clients app has a booking form (frmBookingEdit), with a subform showing
the names of all people on the booking (frmCabinAllocationSF).
As part of the main form, there is a combo box (cboBookingCust) showing
the
name of the "Booking Customer", who is the person to whom correspondence
is
sent. The rowsource for the combo box includes the customer's ID, which is
the bound control.
The subform is presented as a datasheet, and includes the customers Ids
and
names.
I am trying to use conditional formatting to have the booking customer's
name highlighted in red in the subform.
I tried setting the conditional format for the name control on the subform
as follows

Condition1
Expression is
Forms!frmBookingEdit!frmCabinAllocationSF.Controls("CustomerRef")=Forms!frmBookingEdit!cboBookingCust

and then choosing to have the forecolor in red.

Its not working.

Can anyone tell me where I am going wrong?

Many thanks.

Arthur Ross
 
Top