How to let user enter dd/mm/yyyy to dd/mm/yyyy
Hi:
Here I have a imple question. I want to let user enter a period form to in the format of dd/mm/yyyy to dd/mm/yyy.If I want to let user enter in the .. area in the following
../../.... to ../../....
How can I do it.
I try to use text box, with / / to / / in the text field . It doesn't work.
I don't want to use DTpicker.
If anybody can help, It will be very great!!
wky086
Re: How to let user enter dd/mm/yyyy to dd/mm/yyyy
try http://vblib.virtualave.net, there is a function call AllowsOnlyData in vbKeyboard which might help. put the function in the textbox keypress event.
HTH
Re: How to let user enter dd/mm/yyyy to dd/mm/yyyy
Hi:
Thanks for your reply, but I cannot find this function form that website.
wky086
Re: How to let user enter dd/mm/yyyy to dd/mm/yyyy
download the DLL and register it. add a reference to the DLL and you will need to create an instance of vbKeyboard as below
dim vbKeyboard as new vbKeyboard
then you can call
vbKeyboard.AllowsOnlyDate
HTH
Re: How to let user enter dd/mm/yyyy to dd/mm/yyyy
Do validation on LostFocus event. Something like
If left(txtMyDate,3) <> "/" then msgbox "Invalid Format"
If mid(txtMyDate,6,1) <> "/" then msgbox "Invalid Format"
etc
Iouri Boutchkine
[email protected]
Re: How to let user enter dd/mm/yyyy to dd/mm/yyyy
Use Microsoft Masked Edit Control 6.0 and set the .Masked property to ##/##/####
-Cool Bizs