Click to See Complete Forum and Search --> : maskedit date


JRiddick
August 9th, 2000, 11:24 AM
I have a maskedit control with mask ##/##/##__## I'm trying to change to format of the date when the box loses focus, leaving the last two ## alone. I want to get the first 6 number and change it to mm/dd/yy. Any ideas?
thanks,

August 9th, 2000, 01:01 PM
Try this:

option Explicit
Dim strTemp as string
private Sub MaskEdBox1_LostFocus()
'get 6 left characters first
strTemp = Left(MaskEdBox1.ClipText, 6)
'clear the box and change the mask
With MaskEdBox1
.Mask = ""
.Mask = "##/##/##"
'assign saved value
.SelText = strTemp
End With
End Sub



Vlad