| 发表于:2007-06-20 15:35:014楼 得分:0 |
public function chkdate(byval strpara as string, _ optional byval strmsg as string) as boolean if strpara = " " then if strmsg = " " then strmsg = "请输入日期,格式8位[yyyymmdd] 例如: " & format(date, "yyyymmdd ") msgbox strmsg, vbinformation + vbokonly, "系统提示 " goto chk_false end if if not (isdate(format(strpara, "####-##-## ")) _ and len(strpara) = 8) then strmsg = "日期格式应为8位[yyyymmdd] 例如: " & format(date, "yyyymmdd ") msgbox strmsg, vbinformation + vbokonly, "系统提示 " goto chk_false end if chkdate = true: exit function chk_false: chkdate = false end function | | |
|