Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Format textbox for dates

Here's my question:

I have a userform with a few textboxes on it, and I want the textboxes to
display only values of the form dd/mm/yyyy ALL THE TIME. The checking of the
day-, month- and year-values shouldn't happen until I leave the textbox. But
I want to use the keypress-event of the boxes to guarantee the right format
all the time. I've already managed to do this for typing new values, so I
only accept numbers from now on. This all works fine, but if I want to erase
my date, I want to manipulate my textbox so I can erase the numbers, but NOT
the slashes, so that I can't empty the box completely. It should contain
always at least: "//".

Does anyone know the answer to my problem?

Thx,

Lieven
__________________________________________________ _____________________

Lieven Mettepenningen
Software Designer


NISUS Software Architects
Antwerpsesteenweg 107, B-2390 Oostmalle
Tel : +32(0)3/312.92.30 Fax : +32(0)3/311.72.90
http://www.nisus.be


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Format textbox for dates

Hi Lieven

Allow me to disagree with you -being a software designer and all :-). You
should imo let the user enter dates in whichever format she wants and that
the computer can recognize, and make your code validate it and format it
afterwards. I'm in dd-mm country too, and I allow my users enter all kinds
of things into my textboxes, most common are
1. Feb
feb
1.2
1.2-03
1-2-2003
1/3-03
1.2.2003
0102
010203
01022003
-and even
Week 5
Week 5 03

If this idea is of interest then post back and I'll dig up the code for it
from the vault.
--
HTH. Best wishes Harald
Followup to newsgroup only please

"Lieven Mettepenningen" skrev i melding
.be...
Here's my question:

I have a userform with a few textboxes on it, and I want the textboxes to
display only values of the form dd/mm/yyyy ALL THE TIME. The checking of

the
day-, month- and year-values shouldn't happen until I leave the textbox.

But
I want to use the keypress-event of the boxes to guarantee the right

format
all the time. I've already managed to do this for typing new values, so I
only accept numbers from now on. This all works fine, but if I want to

erase
my date, I want to manipulate my textbox so I can erase the numbers, but

NOT
the slashes, so that I can't empty the box completely. It should contain
always at least: "//".

Does anyone know the answer to my problem?

Thx,

Lieven
__________________________________________________ _____________________

Lieven Mettepenningen
Software Designer


NISUS Software Architects
Antwerpsesteenweg 107, B-2390 Oostmalle
Tel : +32(0)3/312.92.30 Fax : +32(0)3/311.72.90
http://www.nisus.be




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Format textbox for dates

Harald,

I don't know about Lieven, but I would certainly be interested in having
a look at your code!

--
Thanks,
Dianne

In ,
Harald Staff typed:
Hi Lieven

Allow me to disagree with you -being a software designer and all :-).
You should imo let the user enter dates in whichever format she wants
and that the computer can recognize, and make your code validate it
and format it afterwards. I'm in dd-mm country too, and I allow my
users enter all kinds of things into my textboxes, most common are
1. Feb
feb
1.2
1.2-03
1-2-2003
1/3-03
1.2.2003
0102
010203
01022003
-and even
Week 5
Week 5 03

If this idea is of interest then post back and I'll dig up the code
for it from the vault.



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
TextBox format? Pas Excel Discussion (Misc queries) 5 April 25th 10 11:13 PM
how to format text in textbox? ghost Excel Discussion (Misc queries) 1 May 18th 08 10:41 AM
TextBox format? AOU Excel Discussion (Misc queries) 4 June 12th 07 11:24 PM
Date format textbox George Excel Discussion (Misc queries) 2 September 20th 06 09:09 PM
TextBox Format grahammal Excel Discussion (Misc queries) 3 March 29th 06 01:35 PM


All times are GMT +1. The time now is 10:20 AM.

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

About Us

"It's about Microsoft Excel"