>>>> Good extra point. Add a check for vartype(lnWidth) and adjust accordingly.
>>
>>I think you are missing the issue, or I am not explaining very well.
>>
>>The Width is there, it is numeric and I can see it.
>>
>>The error occurs when AddProperty() is called, since it's a new property I am adding and since I pass in the value, there should be no possibility of a data type mismatch, but that is what I get.
>
>Yes, I was just thinking about it. I got some weird effects with controls inside the grid long time ago. Is there any way to avoid using AddProperty in your case?
>
>BTW, do you have Access or Assign method for Width in some of your controls?
But wouldn't the error (of assigning a date to .width, for example) happen in these methods, and not on the addproperty line?
Still, you may be into something there. The addproperty() takes arbitrary values, you can assign anything to a property UNLESS it's a built-in property with a specified type and range. Now if it was out of range we'd have a different value. Since Gary has already checked for the .width (being a number), then the remaining thing is to see whether the target property is perhaps defined somewhere as of a different type.
Like I said in the other message, the crucial test would be to rename the property, or at least to try to assign the .width to a property of a different name first.