|
-
Feb 7th, 2000, 09:11 PM
#1
Thread Starter
Lively Member
Can anyone tell me how to format a textbox so that when it gets focus and loses focus that it gets the mask for the short date, "dd,mm,yyyy", that someone will enter?? I need help with this easy one. Thanks.
-
Feb 7th, 2000, 09:28 PM
#2
Member
Why not use the masked edit control? You can then set the mask to whatever you like and still grab the text without a mask. Add the Microsoft Masked Edit Control to your toolbox and then add one to the form.
-
Feb 7th, 2000, 09:59 PM
#3
Thread Starter
Lively Member
I wanted to see what else I could do in code because I already have my txtboxes in place and in different parts of my code.
-
Feb 8th, 2000, 01:52 AM
#4
Sure.
Code:
Private Sub Text1_LostFocus()
If IsDate(Text1.Text) Then
Text1.Text = Format(Text1.Text, "mm,dd,yyyy")
End If
End Sub
As you can see, I'm also checking if the text the user enters is a valid date.
------------------
Serge
Senior Programmer Analyst
[email protected]
[email protected]
ICQ#: 51055819
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|