Click to See Complete Forum and Search --> : mask edit control selection text


Mongoose
February 8th, 2000, 09:31 AM
If the user enters an invalid date for the date mask edit control (mskDate) I'm telling the user they have an invalid date... then i (want) to select the entire text they put in ... but it's not working.... how is this supposed to be done..

here is what i have

If Not IsDate( mskDate.Text )
msgbox "NO... etc"
mskDate.SetFocus
mskDate.SelStart = 0
mskDate.SelLength = Len( mskDate.Text )
End If

it's not working though... any clues?

thankx

February 8th, 2000, 10:37 AM
Your Code works for me with the exception that you have missed the then at the start of the if block
ie.
If Not IsDate( mskDate.Text) THEN