Hey guys,
I have a check box on a form to designate that a salesperson is in training. Default value is 0. When the box is checked, it locks and disables a few controls on the form and it opens up a pop up form to input some extra info. That pop up has a save/close button and a cancel/close button. The cancel button closes the pop up and sets the value of the check box back to 0. The controls stay locked and disabled, though, which I don't want.
I have the following code on the after-update for the check box:
Code:
Private Sub TCheck_AfterUpdate()
If Me.TCheck = -1 Then
DoCmd.OpenForm "TrainingEntry"
Me.ETimeHours.Locked = True
Me.ETimeHours.Enabled = False
Me.ETimeHours.BackColor = vbWhite
Me.CommWages.Locked = True
Me.CommWages.Enabled = False
Me.CommWages.BackColor = vbWhite
Else
Me.ETimeHours.Locked = False
Me.ETimeHours.Enabled = True
Me.ETimeHours.BackColor = vbYellow
Me.CommWages.Locked = False
Me.CommWages.Enabled = True
Me.CommWages.BackColor = vbYellow
Me.TrComm = 0
End If
End Sub
How can I revert the control properties back to the original values (of when check box is 0) when the pop up is closed? I know I could do it with a bunch of extra code on the cancel/close button on the pop up form, but I am assuming there is an event on the main form that I can use or something.
thanks!