Ok, I did as instructed. Did you test this out? It did not seem to have any effect. In both the activate and keypress of a form that I have that uses your class invokes this: "thisform.colorlabel1.caption=log_nbr", even though the log_nbr has advanced to the next record, the colorlabel1 still displays the orig log_nbr.
>Glad you solved the problem, but I need to say something. The class I gave you, only has a basic functionality. If you want to do more than that, such as changing the caption anytime you want (i.e.: when refreshing the form), you have to modify the class.
>
>Update:
>OK. Let's do this.
>- Open up the ColorLabel class
>- Add a method named "SetCaption"
>- Open the Init event, cut all the code there and paste to the SetCaption method
>- Add this code in the Init event:
>
>This.SetCaption()
>
>- From the Class menu, click on "Edit Property/Method.."
>- From the property dialog, Select Caption property then check on the "Assign Method", click on apply.
>- Now you have one more new method called "Caption_Assign". Put this code in that method:
>
>Local ln_X
>
>With This
> If !(.Caption == vNewVal)
> For ln_X = 1 to This.ControlCount
> lc_Object = 'lblName' + alltrim(str( ln_X ))
> .RemoveObject( lc_Object )
> Next
>
> .Caption = vNewVal
> .SetCaption()
> endif
>EndWith
>
>
>Now you can assign the caption anytime you want.
>
>HTH
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."