Date Time help

fccs

New Member
Joined
May 25, 2010
Messages
5
Anyone know any creative methods so you could enter '25' into a date field on a form and have it return a value of '5/25/2010'?

How can I defeat the Date/Time input validation message or get it to act like a text field?

Thanks in advance
Christian
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
How about entering it into an Unbound TextBox on your form, and add some VBA code to the "After Update" event of this text box to build the date you need and then update your date field?
 
Upvote 0
Christian

Couldn't you just use an input mask?

How are you going to know which month the 25 refers to?
 
Upvote 0
Joe4,
Good suggestion and agree that to be an option. However, I was hoping to find a better method as this funactionality would exist in all date fields throughtout the DB.

Thanks for your response
 
Last edited:
Upvote 0
Norie,
via VBA, I would use the current month and year to default to after the only day part has been entered.

This would be like the current functionality of being able to enter '5/25' and it adding the current year automatically to result '5/25/10'. I would just want to add the ability to auto fill the current year and month.

Have not had to deal with input masks other than the standards. What input mask would you recommend?

The datetime field does not like '25' being entered. I assume the validation for the field type is running before any 'AfterUpdate' event runs.
 
Upvote 0
I put something together that borrows heavily from Allen Browne's excellent popup calendar.
You put a button next to the date field. Clicking the button launches a popup form; enter the day, and the formatted date is placed back in the textbox on your form.
Note that the Click event of the button needs to be updated for each textbox.
Example: Call NumberToDate([SomeDateField])

You can download the sample database here.

Denis
 
Upvote 0
SydneyGeek,
I have seen his calendar popup and think it is good also. Unfortunately, while close, that is not what I'm looking for.
Thank you for your input.
C
 
Upvote 0
Take a look at the download I posted. It's *based* on the popup but I think it will do what you need.

Denis
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top