Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Locking field to prevent less than popup calendar date and changes manually

Avatar of Beeyen
Beeyen asked on
Microsoft AccessSQL
12 Comments1 Solution476 ViewsLast Modified:
Hello Experts

I have a field control (DateReceived) which is populated with a date selected from a popup calendar.  I have coded the afterupdate with the following code below to lock the field. When the date is populated into the DateReceived field with the popup calendar you can close the popup calendar but the I-beam remains in the field allowing you to change the date and time, albeit with an error message, but none the less it changes and saves.

What I am trying to accomplish is to not allow a date from the popup calendar entered in to the field to be less than the current date and to disable the ability to enter data manually into the field or to change the date entered in the field from the popup calendar.

Thank you for any assistance you can provide

Private Sub DateReceived_AfterUpdate()
    If Not IsNull(Me.DateReceived) Then
           Me.DateReceived.Locked = True
           Me.DateReceived.BackStyle = "Transparent"
   End If

End Sub
Avatar of conagraman
conagramanFlag of United States of America imagerock star

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answers