We help IT Professionals succeed at work.

disabling controls on form

davetough asked
Hello, am attaching db
open database- click enter time sheet button
select name: dade mike
password: 654321
weekend date: select dec 3rd, 2011
click log on.

I am trying to create method to disable the controls on forms that are not displaying data for the current week.
If you look in the form load code-
I created a field in tblTimeSheets called [Locked]
and there is code in the forms load procedure - but it does not work-
trying to make allowadditions, deletions, and edits False
what i am want is to have controls locked on old time sheet forms and also way admin can unlock to edit.
thank you
Watch Question

Most Valuable Expert 2012
Top Expert 2013
Give these changes a try for the code that disables your controls:

        If mrstTimesheets("Locked") = True And CDate(Me.txtEndDate) < Date Then
            Me.AllowAdditions = False
            Me.AllowDeletions = False
            Me.AllowEdits = False
        End If

Open in new window