condition format on main form to reference subform

BBBryan

Registered User.
Local time
Today, 03:24
Joined
Nov 13, 2010
Messages
122
Hi,
I am having a problem with a condition format.

I have a Main form [CwbWelders fm] and a Sub form [CwbQualifications tbl Subform]
In the Main Form [CwbWelders fm] I have a field [Stamp].
In the [CwbQualifications tbl Subform] I have a field [Expiry Date].

I want to have a condition format of the color of the field [Stamp] on the main form turn Yellow based on the sub form field [Expiry Date]. When the date of the field [Expiry Date] is within 30 days


I put a condition format on the field [Stamp]
Forms![CwbWleders fm]![CwbQualifications tbl Subform].[Expiry Date] <Date()-30 and the color set to yellow.
Its not working.
I must not have the right reference to the subform.


Thanks BBryan
 
No, you have the reference right. The problem is conditional formatting doesn't allow you to change the color of a different control, nor to check a different control. In this case, you'll need to put code doing this into the OnCurrent and OnLoad events for the form, and the AfterUpdate event of the control on the subform.
 
Conditional Formatting works fine on different controls (you use Expression Is). I'm not sure if it will look at other than the first record in the subform. You might try:

Forms![CwbWleders fm]![CwbQualifications tbl Subform].Form.[Expiry Date]

And make sure [CwbQualifications tbl Subform] is the name of the subform control on the mainform, if different than the actual subform.
 
Thanks Guys
I tried the Forms![CwbWelders fm]![CwbQualifications tbl Subform].Form.[Expiry Date] it still didn't work but I did get it to work in VBA

Thanks a lot

BBryan
 

Users who are viewing this thread

Back
Top Bottom