Only Allow Today's Date

Posted on 2012-08-24
Last Modified: 2012-08-29
I have a date field on my continuous form and I want to eliminate the calendar button that shows up when users click into the field.  

I also want to set up OnDblClick event that puts today's date in the field and doesn't allow the user to change the date once today is put in.  I have a function now that wont let users change the date once they leave the record.  But I want it to only allow today's date.
Question by:Scotto123
    LVL 77

    Expert Comment

    Why not set the default value as today's date and lock the control completely.  (Why bother displaying it even?)

    Author Comment

    I need the user to be able to change the field from Null to today.  That's the purpose of the form.

    Accepted Solution

    Got it worked out.  Locked - the field and set up the following:
    Me.Control.Locked = False
    Me.Control.Value = Date
    Me.Control.Locked = True

    Author Closing Comment

    Figured out solution on my own.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This isn't a frequent question on EE. I must have seen it three or four times (among several thousand questions). However, I use this trick quite often, most frequently as a delayed Current event. A form does not expose it's calculation dependenc…
    Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now