Conditional Formatting

  • Thread starter Thread starter Ann
  • Start date Start date
A

Ann

I'm trying to color the text boxes I have on a form and a subform.

I have a form called frmDRSJobs and a subform called subfrmDRSJobsByOperators.

If the [dtmClosedDate] (this is on the main form) is entered all the fields
on the form and subform need to be a different color showing this is a
completed job. I didn't have a problem with the main form using the
conditional formatting option but when I'm on the subform I don't know how to
refer back to the main form. I tried a number of different things, Parent,
Me, using the form name and though I don't get an error nothing happens. Can
someone tell me how to refer back to the main form when using the conditional
formatting option? Thanks for the help.
 
That did it!! Thanks so much for the help.

Clifford Bass said:
Hi Ann,

Try using:

[Forms]![frmDRSJobs]![dtmClosedDate]

Clifford Bass

Ann said:
I'm trying to color the text boxes I have on a form and a subform.

I have a form called frmDRSJobs and a subform called subfrmDRSJobsByOperators.

If the [dtmClosedDate] (this is on the main form) is entered all the fields
on the form and subform need to be a different color showing this is a
completed job. I didn't have a problem with the main form using the
conditional formatting option but when I'm on the subform I don't know how to
refer back to the main form. I tried a number of different things, Parent,
Me, using the form name and though I don't get an error nothing happens. Can
someone tell me how to refer back to the main form when using the conditional
formatting option? Thanks for the help.
 
Hi Cliff,

I ran into a clitch and I wonder if I could get a little more help. The
conditional formatting works when I open the form and show all the records
then all the textboxes in the main and subforms are green. But, if I'm
entering a new closed date that is greater then the open date my conditional
formatting won't change the color for the textboxes on the subform until I
move off the record and then go back again. Is there a way to make it happen
at the time the date is entered like it does for the main form?

Here is the expression in the conditional formatting on the textboxes of the
subform.

([Forms]![frmDRSJobs]![dtmClosedDate]>=[Forms]![frmDRSJobs]![dtmOpenDate])
 
Hi Ann,

It sounds like it is related to the record being or not being saved.
That is often when some other processing gets activated. You might try a
refresh on the subform in the After Update event of the dtmClosedDate:

Private Sub dtmClosedDate_AfterUpdate()
' Not sure of exact format of the sub declaration - create it using the
wizard

subfrmDRSJobsByOperators.Form.Refresh

End Sub

Clifford Bass
 
That worked. You're really great to help me out...thank you!

Clifford Bass said:
Hi Ann,

It sounds like it is related to the record being or not being saved.
That is often when some other processing gets activated. You might try a
refresh on the subform in the After Update event of the dtmClosedDate:

Private Sub dtmClosedDate_AfterUpdate()
' Not sure of exact format of the sub declaration - create it using the
wizard

subfrmDRSJobsByOperators.Form.Refresh

End Sub

Clifford Bass

Ann said:
Hi Cliff,

I ran into a clitch and I wonder if I could get a little more help. The
conditional formatting works when I open the form and show all the records
then all the textboxes in the main and subforms are green. But, if I'm
entering a new closed date that is greater then the open date my conditional
formatting won't change the color for the textboxes on the subform until I
move off the record and then go back again. Is there a way to make it happen
at the time the date is entered like it does for the main form?

Here is the expression in the conditional formatting on the textboxes of the
subform.

([Forms]![frmDRSJobs]![dtmClosedDate]>=[Forms]![frmDRSJobs]![dtmOpenDate])
 
Back
Top