Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Validating a long date in VBA

Hi Everyone, new VBA coder here.

I just wondered if there was an easy of tackling this problem please:

I have a text box on a form which defaults to the current date in long
form i.e. ddd-dd-mm-yyyy. (Obviously this would be mm-dd in some
countries, but this doesn't matter here.)

9 times out of 10 the user won't need to change this date but they may
have to. They will be able to change the current date, for instance,
to yesterday's date rather than today's. Trouble is, they may enter a
valid date but the day of the week wouldn't change automatically,
leading to invalid data - unless they changed it manually.

Is there some way that I can validate a long date? I have come across
some date-validation routines but they only check whether a date is
valid rather than a date-day combination.

Thank you for any insight into this.

W
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Validating a long date in VBA

Hi
I'd choose a different approach. Use this format only for display and have
for example three texboxes (and/or listboxes/spinner controls) to enter the
values for day, month, year separately (and check them). After eentering
update your displayed date

--
Regards
Frank Kabel
Frankfurt, Germany
"will" schrieb im Newsbeitrag
om...
Hi Everyone, new VBA coder here.

I just wondered if there was an easy of tackling this problem please:

I have a text box on a form which defaults to the current date in long
form i.e. ddd-dd-mm-yyyy. (Obviously this would be mm-dd in some
countries, but this doesn't matter here.)

9 times out of 10 the user won't need to change this date but they may
have to. They will be able to change the current date, for instance,
to yesterday's date rather than today's. Trouble is, they may enter a
valid date but the day of the week wouldn't change automatically,
leading to invalid data - unless they changed it manually.

Is there some way that I can validate a long date? I have come across
some date-validation routines but they only check whether a date is
valid rather than a date-day combination.

Thank you for any insight into this.

W



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
Why can't I convert Long date format to Short date Jason Excel Discussion (Misc queries) 1 January 22nd 10 10:24 PM
Validating Date Format exceed_novice Excel Worksheet Functions 5 February 7th 09 05:38 AM
Long Date - Long Date = text is days tom Excel Discussion (Misc queries) 2 November 13th 06 04:17 AM
Validating a date field kenelder Excel Discussion (Misc queries) 2 February 16th 05 10:50 PM
Validating entered data as date Mr. B[_3_] Excel Programming 2 April 9th 04 01:40 PM


All times are GMT +1. The time now is 03:57 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"