the line that it highlighted was the
Private Sub Frame28_AfterUpdate()
Somehow I got the code to work by adding the not to the code like this, but this didn't work for another field that is a yes no checkbox because it would keep the second field always enabled:
Private Sub Frame28_AfterUpdate()
If not Frame28 Then ' if frame28 is ticked
Me.Participant_Last_Name.Enabled = True
Me.Participant_First_Name.Enabled = True
Me.Birth_Date.Enabled = True
Me.Unit_No.Enabled = True
Me.Provider_Name.Enabled = True
Me.Island.Enabled = True
Me.Contact_Person.Enabled = True
Me.Telephone_No.Enabled = True
Me.Fax_No.Enabled = True
Me.Relationship.Enabled = True
Me.Supervisor_Name_Designated_Rep_Title.Enabled = True
Else
Me.Participant_Last_Name.Enabled = False
Me.Participant_First_Name.Enabled = False
Me.Birth_Date.Enabled = False
Me.Unit_No.Enabled = False
Me.Provider_Name.Enabled = False
Me.Island.Enabled = False
Me.Contact_Person.Enabled = False
Me.Telephone_No.Enabled = False
Me.Fax_No.Enabled = False
Me.Relationship.Enabled = False
Me.Supervisor_Name_Designated_Rep_Title.Enabled = False
End If
End Sub
Here is the second code that didn't work (note that I had to also switch around the false and the true statement too in order to enable when checked and disable when not checked. If not it enabled when not checked and disabled when checked) If I used this
code it would keep the who_was_notified_police_name field enabled automatically when going to a new record:
Private Sub Who_Was_Notified_Police_AfterUpdate()
if who_was_notified_police then
me.who_was_notified_police_name.enabled = false
me.who_was_notified_police_name.enabled=true
end if
end sub