Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forcing entry into validation cell Bfrank Excel Discussion (Misc queries) 1 June 15th 09 06:43 PM
forcing cell entry with validation Colleen Excel Discussion (Misc queries) 1 December 11th 06 09:10 PM
Forcing an entry [email protected] Excel Discussion (Misc queries) 3 October 19th 06 10:04 PM
Checking & Forcing Data Entry in Cells robertguy Excel Discussion (Misc queries) 1 January 23rd 06 06:01 PM
Forcing Combo box entry in VBA Anthony Slater Excel Discussion (Misc queries) 1 December 1st 04 03:09 PM


All times are GMT +1. The time now is 08:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"