Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Forcing Date Entry
Anyone know the code to use in order to force a user to fill in a
(text?)box with a date in the following format: DD/MM/YY If possible can the "/"s be already in place so that only the spaces can be filled in eg. [ / / ] Thanks --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Forcing Date Entry
can't already have the /
no way to tell if the user complied or not 02/05/03 Did the user comply or not? Use three textboxes - one for day, one for month, one for year -- Regards, Tom Ogilvy "rbaxter" wrote in message ... Anyone know the code to use in order to force a user to fill in a (text?)box with a date in the following format: DD/MM/YY If possible can the "/"s be already in place so that only the spaces can be filled in eg. [ / / ] Thanks --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Forcing Date Entry
If you have text box you can use the IsDate function, I
use several functions to pull the locale date format of the user but if you and your workbook are just based in the US then just set a global string value of mm/dd/yy and set your text box to this default value, itkind of acts as a reminder to the user of what to type and on the _Exit procdure of your text box you need to have something like this If Not IsDate(Me.txtBox) And Me.txtBox< mstrDateFormat Then gstrFrmMsg = "The date that you have entered is not a date value." MsgBox gstrFrmMsg, vbOKOnly Or vbInformation Me.txtBox= mstrDateFormat Me.txtBox.SelStart = 0 Me.txtBox.SelLength = Len(Me.txtBox) Cancel = True End If hope this helps regards KM -----Original Message----- can't already have the / no way to tell if the user complied or not 02/05/03 Did the user comply or not? Use three textboxes - one for day, one for month, one for year -- Regards, Tom Ogilvy "rbaxter" wrote in message ... Anyone know the code to use in order to force a user to fill in a (text?)box with a date in the following format: DD/MM/YY If possible can the "/"s be already in place so that only the spaces can be filled in eg. [ / / ] Thanks --- Message posted from http://www.ExcelForum.com/ . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Forcing Date Entry
This 02/05/03
would pass isdate whether it was Feb 5 2003 May 2 2003 Mar 2 2005 etc. If the OP were US why would they want the date as DD/MM/YY Saying use Me.txtBox< mstrDateFormat Without explaining what mstrDateFormat holds or how it is established is pretty useless. It might be useful to test for dd/mm/yy if the user will be using this yo enter the date for some specific reason - beyond that, it is silly to restrict entry to that format when other forms are non-ambiguous and can easily be converted correctly to that format in code. -- Regards, Tom Ogilvy "KM" wrote in message ... If you have text box you can use the IsDate function, I use several functions to pull the locale date format of the user but if you and your workbook are just based in the US then just set a global string value of mm/dd/yy and set your text box to this default value, itkind of acts as a reminder to the user of what to type and on the _Exit procdure of your text box you need to have something like this If Not IsDate(Me.txtBox) And Me.txtBox< mstrDateFormat Then gstrFrmMsg = "The date that you have entered is not a date value." MsgBox gstrFrmMsg, vbOKOnly Or vbInformation Me.txtBox= mstrDateFormat Me.txtBox.SelStart = 0 Me.txtBox.SelLength = Len(Me.txtBox) Cancel = True End If hope this helps regards KM -----Original Message----- can't already have the / no way to tell if the user complied or not 02/05/03 Did the user comply or not? Use three textboxes - one for day, one for month, one for year -- Regards, Tom Ogilvy "rbaxter" wrote in message ... Anyone know the code to use in order to force a user to fill in a (text?)box with a date in the following format: DD/MM/YY If possible can the "/"s be already in place so that only the spaces can be filled in eg. [ / / ] Thanks --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Forcing entry into validation cell | Excel Discussion (Misc queries) | |||
forcing cell entry with validation | Excel Discussion (Misc queries) | |||
Forcing an entry | Excel Discussion (Misc queries) | |||
Checking & Forcing Data Entry in Cells | Excel Discussion (Misc queries) | |||
Forcing Combo box entry in VBA | Excel Discussion (Misc queries) |