Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format text box in Continuous Form 1

Status
Not open for further replies.

dpimental

Programmer
Jul 23, 2002
535
US
I have looked through the posts and still don't understand the trick to formatting on a continuous form.

I have tried comparing date_field1 to date_field2 and then format date_field2 based on what the comparison gave me.

Do I try it on_Open, on_Load, etc?

Also, do I need to cycle through all the controls?

Every time I try this, once the condition is met, it applies it to all cases, regardless of whether they meet the condition or not?

Here's my scenario
I have 3 dates.
A due date, an estimated date and an actual date
The estimated date and actual date are to be compared to the due date.

There are 3 possibilities for each comparison.
1. The dates are equal (use black forecolor).
2. The est./act. date is less than the due date (use blue)
3. The est./act. date is greater than the due date (use red)

Any ideas on this?

David Pimental
(US, Oh)
 
i think it's unnecessairy to use code here. Try conditional formatting.
Right click the control that needs special formatting and then click conditional formatting. The dialog that appears should explain itself.
 
I am comparing dates that change from record to record; but are listed in a continuous form, so that wouldn't work. Here is what they look like

due date est. date act. date

04/01/2007 04/02/2007 04/02/2007
04/10/2007 04/12/2007 04/10/2007
04/14/2007 04/12/2007 04/22/2007
05/01/2007 05/02/2007 05/22/2007
06/01/2007 06/01/2007 06/01/2007

So, you see only the last record has a "good" date (an est. and act. date equal to the due date). So, I need to format each date differently.

How to I programmatically change the format of each individual record within a continuous form so that each "row" could have different forecorlor?

Do you need to cycle through the control collection? Can you use Conditional Formatting programatically for each record? Is there any way to say if estimate date is greter than due date, forecolor = 255, else forecolor = 0?

David Pimental
(US, Oh)
 
Thanks for your help. I finally figured out the conditional formatting using an expression.

Man, that is great. Thanks for the help. Have a star on me.

Yeah, I know you didn't do a lot; But I didn't need a lot and I got a lot in return.

Bless you!

David Pimental
(US, Oh)
 
No, problem. glad to help. And this is my first star :-D
so thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top