This code is located in a forum, once a checkbox is unchecked then the code executes. Also I am the only one with access to this program, so there aren't any other users.
Private Sub gotoRightAdd(hellomyman As String)
'----------------------------------------------------------
' a procedure used for the checkADDInspection method
' to go to the specific addition
'----------------------------------------------------------
Dim str As String, rs As DAO.Recordset
str = "select * from box_additions where [add_number_in_list]=" & Me.AC_ID_IN_LIST.Value & ";"
Set rs = CurrentDb.OpenRecordset(str)
If rs.EOF And rs.BOF Then
Exit Sub
End If
rs.MoveFirst
DoCmd.SelectObject acForm, "List_Information_frm"
Forms!List_Information_frm!ADDITIONS_MAIN_frm!AC_Box_Additions_frm.SetFocus
DoCmd.GoToRecord , , acFirst
Do Until rs.EOF
If rs.Fields("add_number") = hellomyman Then
Exit Do
End If
DoCmd.GoToRecord , , acNadd
rs.MoveNadd
Loop
rs.Close
End Sub
Private Sub uncheckALLAdd(whatsup As Integer)
'----------------------------------------------------------
' used for the checkAddInspection method
' to uncheck all additions related to the add. no.
'----------------------------------------------------------
Dim str As String, rs As DAO.Recordset
str = "select * from box_additions WHERE [add_NUMBER_IN_LIST]=" & Me.AC_ID_IN_LIST.Value & ";"
Set rs = CurrentDb.OpenRecordset(str)
If rs.EOF And rs.BOF Then
Else
rs.MoveFirst
Do Until rs.EOF
'MsgBox rs.Fields("add_number")
rs.Edit
rs.Fields("ReadyForInspection") = whatsup
rs.Update
rs.MoveNadd
Loop
End If
Set rs = Nothing
rs.Close
End Sub