let's say that there are 2 input boxes: txtbox1 and txtbox2
if a user enter a value other than date with format mm/dd/yyyy then a messagebox "INPUT MUST BE DATE ONLY" should prompt.
here's a part of my code:
if txtbox1.text or txtbox2.text= (what should i put here for the txtbox1 and txtbox 2 to accept only a date value???)
then
msgbox("INPUT MUST BE DATE ONLY")
end if
how to make an input to accept only a date?
Page 1 of 12 Replies - 2496 Views - Last Post: 10 September 2009 - 07:36 AM
Replies To: how to make an input to accept only a date?
#2
Re: how to make an input to accept only a date?
Posted 10 September 2009 - 05:47 AM
why to use textboxes when you can use DTPicker
use "Microsoft Windows Common Controls - 2 6.0 (SP4) -> MSCOMCT2.OCX" it is standart OCX there is DTPicker Control that can select date so you dont need to check if the user write date in the textbox.
good luck
good luck
This post has been edited by NoBrain: 10 September 2009 - 07:36 AM
#3
Re: how to make an input to accept only a date?
Posted 10 September 2009 - 07:36 AM
onother way error hendler
the cdate() function will generete error and will go to error hendler
good luck
the cdate() function will generete error and will go to error hendler
private function somefunc()
on error goto err_h
str1=cdate(textbox1.text)
str2=cdate(textbox2.text)
exit function
err_h:
msgbox("INPUT MUST BE DATE ONLY")
end fucntion
good luck
This post has been edited by NoBrain: 10 September 2009 - 07:36 AM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|