Public Sub fixFormFieldsMaxLength(ByVal currForm As MicroFour.StrataFrame.UI.Windows.Forms.StandardForm) For Each currControl As Control In currForm.Controls fixFieldsMaxLength(currControl, currForm) Next End Sub Public Sub fixFieldsMaxLength(ByVal currContainer As Control, ByVal currForm As MicroFour.StrataFrame.UI.Windows.Forms.StandardForm) Dim allBOForm As MicroFour.StrataFrame.Business.BusinessObjectCollection = currForm.BusinessObjects For Each currControl As Control In currContainer.Controls If currControl.HasChildren Then fixFieldsMaxLength(currControl, currForm) End If For Each currBO As MicroFour.StrataFrame.Business.BusinessLayer In allBOForm If TypeOf currControl Is Textbox Then Dim box As MicroFour.StrataFrame.UI.Windows.Forms.Textbox = TryCast(currControl, MicroFour.StrataFrame.UI.Windows.Forms.Textbox) If box.BusinessObject Is currBO AndAlso box.BindingField <> Nothing AndAlso currBO.FieldLengths(box.BindingField) > 0 Then box.MaxLength = currBO.FieldLengths(box.BindingField) End If End If Next Next End Sub