Is there a way to setup the entry field in a textbox to accept
a date entry only?
Like ' __/__/____ '
?
------------------
Henning
a date entry only?
Like ' __/__/____ '
?
------------------
Henning
DECLARE FUNCTION VarDateFromStr LIB "OLEAUT32.DLL" ALIAS "VarDateFromStr" (BYVAL OleString AS LONG, BYVAL lcid AS LONG, BYVAL dwFlags AS LONG, pDate AS DOUBLE) AS LONG DECLARE FUNCTION VariantTimeToSystemTime LIB "OLEAUT32.DLL" ALIAS "VariantTimeToSystemTime" (BYVAL vbtime AS DOUBLE, lpSystemTime AS SYSTEMTIME) AS LONG ... FUNCTION StringToSystemTime( strDateTime$, ST AS SYSTEMTIME) AS LONG LOCAL TmpDate$, rc& LOCAL varDate AS DOUBLE LOCAL LCID AS LONG LCID = GetThreadLocale() TmpDate$ = SPACE$(LEN(strDateTime$) * 2) MultiByteToWideChar %CP_ACP, _ ' code page %NULL, _ ' performance and mapping flags BYVAL STRPTR(strDateTime$), _ ' ANSI string to convert LEN(strDateTime$), _ ' len of ANSI string BYVAL STRPTR(TmpDate$), _ ' buffer for Unicode string LEN(TmpDate$) ' len of Unicode buffer TmpDate$ = TmpDate$ & CHR$(0,0) rc& = VarDateFromStr(BYVAL STRPTR(TmpDate$), _ BYVAL LCID,BYVAL %LOCALE_NOUSEROVERRIDE, _ BYVAL VARPTR(varDate)) IF rc& <> %S_OK THEN FUNCTION = rc&:EXIT FUNCTION VariantTimeToSystemTime varDate, ST FUNCTION = 0 END FUNCTION ... a$ = <date input string> 'Get date string from edit box StringToSystemTime a$, ST 'Convert to SYSTEMTIME
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment