LOCAL lcAlias, lcField, lcType, laFields[1], ; lnElement, lnRow, lcIntegerPart, lcDecimalPart WITH This IF ! EMPTY( .ControlSource ) IF EMPTY( .InputMask ) *** Only set the inputmask for numeric and character fields *** and check the data type of the underlying field so we *** can set it appropriately lcType = TYPE( This.ControlSource ) IF INLIST( lcType, 'C', 'N' ) *** Parse the alias and the field name from the ControlSource lcAlias = JUSTSTEM( .ControlSource ) lcField = JUSTEXT ( .ControlSource ) *** Don't attempt to check the properties of the underlying *** field if we are bound to a form property IF UPPER( lcAlias ) # 'THISFORM' *** format the field if it is character IF lcType = 'C' .InputMask = REPLICATE( 'X', FSIZE( lcField, lcAlias ) ) ELSE AFIELDS(laFields, lcAlias) lnElement = ASCAN(laFields, UPPER(lcField)) IF lnElement > 0 lnRow = ASUBSCRIPT(laFields, lnElement, 1) lcIntegerPart = REPLICATE('9', laFields[lnRow, 3] - laFields[lnRow, 4] - 1) lcDecimalPart = REPLICATE('9', laFields[lnRow, 4]) .InputMask = lcIntegerPart + '.' + lcDecimalPart ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDWITHMarcia