Here is the print screen to show you the field has a yes/no data type. I took out the default value of "no" and used your nz code. It now looks like this:
Private Sub Who_Was_Notified_Police_AfterUpdate()
If Nz(Who_Was_Notified_Police, False) Then
Me.Who_Was_Notified_Police_Name.Enabled = True
Me.Who_Was_Notified_Police_Date.Enabled = True
Me.Who_Was_Notified_Police_Report_No.Enabled = True
Me.Who_Was_Notified_Police_Name.SetFocus
Else
Me.Who_Was_Notified_Police_Name.Enabled = False
Me.Who_Was_Notified_Police_Date.Enabled = False
Me.Who_Was_Notified_Police_Report_No.Enabled = False
End If
End Sub
I looked into the nz code and it is basically saying (correct me if I am wrong) that if the "Who_Was_Notified_Police" is null to return "false" and if not return the value of "Who_Was_Notified_Police". I don't understand how this still works if the answer
is "no". How does this code still know to disable the fields properly? I ask this because to me, it doesn't seem to say enable the fields only when the "Who_Was_Notified_Police" is "true" and disable when "false". I would've thought that you needed it to
say something like "Who_Was_Notified_Police=who_was_notified_police_name and Nz(Who_Was_Notified_Police, False) somehow for when the value is null. The second code works too, but it actually works with just the "if Who_Was_Notified_Police = True" without the
"If Not IsNull(Who_Was_Notified_Police)". This second code seems to say only when the "Who_Was_Notified_Police" is "yes" or "true" or "-1" to enable me.who_was... fields, so if it is "no" "false" or "null" to disable and that one makes sense to me. Sorry
for so much questions, but I am just trying to understand these codes and how they work without just copying stuff you all help me with. I appreciate all the time you all take to help us newbies.