Help disableling buttons after update (1 Viewer)

hursan1710

New member
Local time
Today, 06:41
Joined
May 21, 2017
Messages
1
I need help with the attached MS task database, i want to do the flowing:

Once a task is created, i want the following fields on the "Task Details" to be disable and not enable unless a new Task is created.

Task Title, Assigned to, Priority and download date: i want these fields to be lock and the downloaded button to be disable for this task after "Close" button is click.

then when a user opens the task i want the user to only be able to modified: % complete, status, and check in and Check In button.

once the user clicks Check In i want to form to close automatically and the check in button to be disable for this task.

then when the user comes back to this task i want the user to only be able to modify "% completed, Status and Check out button", when the user click Check Out, to lock the 'Check Out" button and the form to close automatically.
hopefully someone can help me.

i attached a copy of the database
 

Attachments

  • Database9.zip
    427.2 KB · Views: 51

HiTechCoach

Well-known member
Local time
Today, 08:41
Joined
Mar 6, 2006
Messages
4,357
I would recommend using the Form's On Current event and VBA code to enable/disable the buttons and controls as needed.

Code:
Private Sub Form_Current()

If Me.NewRecord = True Then
  ' new record allow edit
    Me.TaskDetails.Locked = False
Else
  ' existing record disable edits
    Me.TaskDetails.Locked = True
End If

End Sub

or this is how I do it:

Code:
Private Sub Form_Current()

      Me.TaskDetails.Locked = Not NewRecord

End Sub

Both examples give the exact same results. The first one is easy to understand when learning VBA. The second one is very optimized.
 

Users who are viewing this thread

Top Bottom