Problem making enable/disable persist

derekbrown

Registered User.
Local time
Today, 03:26
Joined
Jun 8, 2005
Messages
12
The following code governs whether two fields are enabled/disableddependent on a selection made in a frame with 4 radio buttons. All are bound controls.

The first time that you select an option it's fine and the fields disable correctly, however, when I close the form and then go back into it the controls that should be disabled are enabled. I have to reselect the appropriate radio button to enable/disable the fields again.

Can anyone let me know what I am doing wrong?

Cheers

Private Sub fraSysSel_AfterUpdate()

If fraSysSel.Value = 1 Then

Conditions_Expected.Enabled = False
Actual_Conditions.Enabled = False

Else

Conditions_Expected.Enabled = True
Actual_Conditions.Enabled = True

End If

End Sub
 
You need to also run the code in the form's OnCurrent event.
 
Thanks

Thanks, worked like a charm!
 

Users who are viewing this thread

Back
Top Bottom