Now () has undone my input mask! Why?

Joined
Mar 23, 2004
Messages
241
Hi everyone.

I've got a short date validation on a date field on my form to make sure users enter the correct information.

I've just added a further bit of code so that when they change a separate field, the date box automatically populates with today's date for them. I did this using Me.DateCompleted = Now(). Seems to work fine. The date appears in the required (UK) dd/mm/yyyy format.

The problem is, they still need to be able to edit the date if needs be. When you click on the field once it's done its Now() update, the date shows something like 07/02/2004 12:44:02. If you then go in and update it, it allows you to press the "Enter" key to put a new line in the cell.

I don't want it to do this, because the cell's only one line high, and it might confuse the living daylights out of some of the people we've got using the db if the date they've entered randomly apparently disappears...

I also want it to still have the __/__/____ prompt it has if you were to enter the date into the blank cell...

Any ideas how I can get the validation to remain intact throughout?

Any help would be greatly appreciated!! :biggrin:

Cheers,
CSBBB.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Why not use Date instead of Now?

It will only return the date not the data and time.

I don't know how it'll work with the input mask though.
 
Upvote 0

Forum statistics

Threads
1,221,848
Messages
6,162,419
Members
451,765
Latest member
craigvan888

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