if not dodefault() return .f. endif with this if empty(.cControlSource) .cControlSource = .controlsource endif if empty(.cControlSource) if .lDateTime .value = iif(.lCurrent,datetime(),{//::}) && Initialize with the current or empty datetime else .value = iif(.lCurrent,date(),{}) && Initialize with the current or empty date endif endif if type('.ControlSource') = "C" or .lDateTime do case case .lDateTime OR type(.controlsource) = "T" * we can not set format to R .Format = "R" otherwise .format = "D" .inputmask = "" endcase endif endwithI use StrictDataEntry property as 0 - Loose and InputMask as =strtran(CHRTRAN(TRANSFORM(DATETIME()),"1234567890","9999999999"),"P","A")