Option Compare Database
Private Sub Check1_AfterUpdate()
If Me.Check1 = True Then
Me.Frame1.Enabled = True
Me.Check1.Locked = True
Else
Me.Frame1.Enabled = False
Me.Check1.Locked = True
End If
End Sub
Private Sub Check2_AfterUpdate()
If Me.Check2 = True Then
Me.Frame2.Enabled = True
Me.Check2.Locked = True
Else
Me.Frame2.Enabled = False
Me.Check2.Locked = True
End If
End Sub
Private Sub Check3_AfterUpdate()
If Me.Check3 = True Then
Me.Frame3.Enabled = True
Me.Check3.Locked = True
Else
Me.Frame3.Enabled = False
Me.Check3.Locked = True
End If
End Sub
Private Sub Check4_AfterUpdate()
If Me.Check4 = True Then
Me.Frame4.Enabled = True
Me.Check4.Locked = True
Else
Me.Frame4.Enabled = False
Me.Check4.Locked = True
End If
End Sub
Private Sub Check5_AfterUpdate()
If Me.Check5 = True Then
Me.Frame5.Enabled = True
Me.Check5.Locked = True
Else
Me.Frame5.Enabled = False
Me.Check5.Locked = True
End If
End Sub
Private Sub Check6_AfterUpdate()
If Me.Check6 = True Then
Me.Frame6.Enabled = True
Me.Check6.Locked = True
Else
Me.Frame6.Enabled = False
Me.Check6.Locked = True
End If
End Sub
Private Sub Check7_AfterUpdate()
If Me.Check7 = True Then
Me.approversother.Enabled = True
Me.Frame7.Enabled = True
Me.Check7.Locked = True
Else
Me.approversother.Enabled = False
Me.Frame7.Enabled = False
Me.Check7.Locked = True
End If
End Sub
Private Sub Form_Current()
If User.AccessID = 1 Then ' Admin
Me.Check1.Enabled = True
Me.Check2.Enabled = True
Me.Check3.Enabled = True
Me.Check4.Enabled = True
Me.Check5.Enabled = True
Me.Check6.Enabled = True
Me.Check7.Enabled = True
Me.Frame1.Enabled = True
Me.Frame2.Enabled = True
Me.Frame3.Enabled = True
Me.Frame4.Enabled = True
Me.Frame5.Enabled = True
Me.Frame6.Enabled = True
Me.Frame7.Enabled = True
ElseIf User.AccessID = 8 Then 'Quality
If (Me.Check1.Enabled = True) Or (Me.Check1.Enabled = False) Then
Me.Frame1.Enabled = False
Me.Check35.Enabled = False
Me.Check36.Enabled = False
End If
If (Me.Check2.Enabled = True) Or (Me.Check2.Enabled = False) Then
Me.Frame2.Enabled = False
Me.Check37.Enabled = False
Me.Check38.Enabled = False
End If
If (Me.Check3.Enabled = True) Or (Me.Check3.Enabled = False) Then
Me.Frame3.Enabled = False
Me.Check39.Enabled = False
Me.Check40.Enabled = False
End If
If (Me.Check4.Enabled = True) Or (Me.Check4.Enabled = False) Then
Me.Frame4.Enabled = False
Me.Check41.Enabled = False
Me.Check42.Enabled = False
End If
If (Me.Check5.Enabled = True) Or (Me.Check5.Enabled = False) Then
Me.Frame5.Enabled = False
Me.Check43.Enabled = False
Me.Check44.Enabled = False
End If
If (Me.Check6.Enabled = True) Or (Me.Check6.Enabled = False) Then
Me.Frame6.Enabled = False
Me.Check45.Enabled = False
Me.Check46.Enabled = False
End If
If (Me.Check7.Enabled = True) Or (Me.Check7.Enabled = False) Then
Me.Frame7.Enabled = False
Me.Check47.Enabled = False
Me.Check48.Enabled = False
End If
ElseIf User.AccessID = 7 Then 'Approvers
Me.Check1.Locked = True
Me.Check2.Locked = True
Me.Check3.Locked = True
Me.Check4.Locked = True
Me.Check5.Locked = True
Me.Check6.Locked = True
Me.Check7.Locked = True
Else 'Initiators, and Investigators
Me.Check1.Enabled = False
Me.Check2.Enabled = False
Me.Check3.Enabled = False
Me.Check4.Enabled = False
Me.Check5.Enabled = False
Me.Check6.Enabled = False
Me.Check7.Enabled = False
Me.Frame1.Enabled = False
Me.Frame2.Enabled = False
Me.Frame3.Enabled = False
Me.Frame4.Enabled = False
Me.Frame5.Enabled = False
Me.Frame6.Enabled = False
Me.Frame7.Enabled = False
End If
If User.AccessID = 7 Then 'Approvers
If Me.Check1 = True Then
Me.Frame1.Locked = False
Me.Check35.Locked = False
Me.Check36.Locked = False
Else
Me.Frame1.Locked = True
Me.Check35.Locked = True
Me.Check36.Locked = True
End If
If Me.Check2 = True Then
Me.Frame2.Locked = False
Me.Check37.Locked = False
Me.Check38.Locked = False
Else
Me.Frame2.Locked = True
Me.Check37.Locked = True
Me.Check38.Locked = True
End If
If Me.Check3 = True Then
Me.Frame3.Locked = False
Me.Check39.Locked = False
Me.Check40.Locked = False
Else
Me.Frame3.Locked = True
Me.Check39.Locked = True
Me.Check40.Locked = True
End If
If Me.Check4 = True Then
Me.Frame4.Locked = False
Me.Check41.Locked = False
Me.Check42.Locked = False
Else
Me.Frame4.Locked = True
Me.Check41.Locked = True
Me.Check42.Locked = True
End If
If Me.Check5 = True Then
Me.Frame5.Locked = False
Me.Check43.Locked = False
Me.Check44.Locked = False
Else
Me.Frame5.Locked = True
Me.Check43.Locked = True
Me.Check44.Locked = True
End If
If Me.Check6 = True Then
Me.Frame6.Locked = False
Me.Check45.Locked = False
Me.Check46.Locked = False
Else
Me.Frame6.Locked = True
Me.Check45.Locked = True
Me.Check46.Locked = True
End If
If Me.Check7 = True Then
Me.Frame7.Locked = False
Me.Check47.Locked = False
Me.Check48.Locked = False
Else
Me.Frame7.Locked = True
Me.Check47.Locked = True
Me.Check48.Locked = True
End If
End If
If Frame1.Value = 3 Then
Me.rejectcomments.Enabled = False
Me.Frame1.Enabled = False
ElseIf Frame1.Value = 4 Then
Me.rejectcomments.Enabled = True
Me.Frame1.Enabled = False
Else
Me.rejectcomments.Enabled = False
End If
If Me.rejectcomments <> "" Then
Me.rejectcomments.Enabled = False
End If
If Frame2.Value = 5 Then
Me.rejectcommentsRegulatory.Enabled = False
Me.Frame2.Enabled = False
ElseIf Frame2.Value = 6 Then
Me.rejectcommentsRegulatory.Enabled = True
Me.Frame2.Enabled = False
Else
Me.rejectcommentsRegulatory.Enabled = False
End If
If Me.rejectcommentsRegulatory <> "" Then
Me.rejectcommentsRegulatory.Enabled = False
End If
If Frame3.Value = 7 Then
Me.rejectcommentsRD.Enabled = False
Me.Frame3.Enabled = False
ElseIf Frame2.Value = 8 Then
Me.rejectcommentsRD.Enabled = True
Me.Frame3.Enabled = False
Else
Me.rejectcommentsRD.Enabled = False
End If
If Me.rejectcommentsRD <> "" Then
Me.rejectcommentsRD.Enabled = False
End If
If Frame4.Value = 9 Then
Me.rejectcommentsManuf.Enabled = False
Me.Frame4.Enabled = False
ElseIf Frame4.Value = 10 Then
Me.rejectcommentsManuf.Enabled = True
Me.Frame4.Enabled = False
Else
Me.rejectcommentsManuf.Enabled = False
End If
If Me.rejectcommentsManuf <> "" Then
Me.rejectcommentsManuf.Enabled = False
End If
If Frame5.Value = 11 Then
Me.rejectcommentsGMS.Enabled = False
Me.Frame5.Enabled = False
ElseIf Frame5.Value = 12 Then
Me.rejectcommentsGMS.Enabled = True
Me.Frame5.Enabled = False
Else
Me.rejectcommentsGMS.Enabled = False
End If
If Me.rejectcommentsGMS <> "" Then
Me.rejectcommentsGMS.Enabled = False
End If
If Frame6.Value = 13 Then
Me.rejectcommentsPurchasing.Enabled = False
Me.Frame6.Enabled = False
ElseIf Frame6.Value = 14 Then
Me.rejectcommentsPurchasing.Enabled = True
Me.Frame6.Enabled = False
Else
Me.rejectcommentsPurchasing.Enabled = False
End If
If Me.rejectcommentsPurchasing <> "" Then
Me.rejectcommentsPurchasing.Enabled = False
End If
If Frame7.Value = 15 Then
Me.rejectcommentsOther.Enabled = False
Me.Frame7.Enabled = False
ElseIf Frame7.Value = 16 Then
Me.rejectcommentsOther.Enabled = True
Me.Frame7.Enabled = False
Else
Me.rejectcommentsOther.Enabled = False
End If
If Me.rejectcommentsOther <> "" Then
Me.rejectcommentsOther.Enabled = False
End If
End Sub
Private Sub Form_Open(cancel As Integer)
On Error GoTo Err_Form_Open
If User.AccessID = 1 Then ' Admin
Me.Check1.Enabled = True
Me.Check2.Enabled = True
Me.Check3.Enabled = True
Me.Check4.Enabled = True
Me.Check5.Enabled = True
Me.Check6.Enabled = True
Me.Check7.Enabled = True
Me.Frame1.Enabled = True
Me.Frame2.Enabled = True
Me.Frame3.Enabled = True
Me.Frame4.Enabled = True
Me.Frame5.Enabled = True
Me.Frame6.Enabled = True
Me.Frame7.Enabled = True
ElseIf User.AccessID = 8 Then 'Quality
If (Me.Check1.Enabled = True) Or (Me.Check1.Enabled = False) Then
Me.Frame1.Enabled = False
Me.Check35.Enabled = False
Me.Check36.Enabled = False
End If
If (Me.Check2.Enabled = True) Or (Me.Check2.Enabled = False) Then
Me.Frame2.Enabled = False
Me.Check37.Enabled = False
Me.Check38.Enabled = False
End If
If (Me.Check3.Enabled = True) Or (Me.Check3.Enabled = False) Then
Me.Frame3.Enabled = False
Me.Check39.Enabled = False
Me.Check40.Enabled = False
End If
If (Me.Check4.Enabled = True) Or (Me.Check4.Enabled = False) Then
Me.Frame4.Enabled = False
Me.Check41.Enabled = False
Me.Check42.Enabled = False
End If
If (Me.Check5.Enabled = True) Or (Me.Check5.Enabled = False) Then
Me.Frame5.Enabled = False
Me.Check43.Enabled = False
Me.Check44.Enabled = False
End If
If (Me.Check6.Enabled = True) Or (Me.Check6.Enabled = False) Then
Me.Frame6.Enabled = False
Me.Check45.Enabled = False
Me.Check46.Enabled = False
End If
If (Me.Check7.Enabled = True) Or (Me.Check7.Enabled = False) Then
Me.Frame7.Enabled = False
Me.Check47.Enabled = False
Me.Check48.Enabled = False
End If
ElseIf User.AccessID = 7 Then 'Approvers
Me.Check1.Locked = True
Me.Check2.Locked = True
Me.Check3.Locked = True
Me.Check4.Locked = True
Me.Check5.Locked = True
Me.Check6.Locked = True
Me.Check7.Locked = True
Else 'Initiators, and Investigators
Me.Check1.Enabled = False
Me.Check2.Enabled = False
Me.Check3.Enabled = False
Me.Check4.Enabled = False
Me.Check5.Enabled = False
Me.Check6.Enabled = False
Me.Check7.Enabled = False
Me.Frame1.Enabled = False
Me.Frame2.Enabled = False
Me.Frame3.Enabled = False
Me.Frame4.Enabled = False
Me.Frame5.Enabled = False
Me.Frame6.Enabled = False
Me.Frame7.Enabled = False
End If
If User.AccessID = 7 Then 'Approvers
If Me.Check1 = True Then
Me.Frame1.Locked = False
Me.Check35.Locked = False
Me.Check36.Locked = False
Else
Me.Frame1.Locked = True
Me.Check35.Locked = True
Me.Check36.Locked = True
End If
If Me.Check2 = True Then
Me.Frame2.Locked = False
Me.Check37.Locked = False
Me.Check38.Locked = False
Else
Me.Frame2.Locked = True
Me.Check37.Locked = True
Me.Check38.Locked = True
End If
If Me.Check3 = True Then
Me.Frame3.Locked = False
Me.Check39.Locked = False
Me.Check40.Locked = False
ElseIf Me.Check3 = False Then
Me.Frame3.Locked = True
Me.Check39.Locked = True
Me.Check40.Locked = True
End If
If Me.Check4 = True Then
Me.Frame4.Locked = False
Me.Check41.Locked = False
Me.Check42.Locked = False
Else
Me.Frame4.Locked = True
Me.Check41.Locked = True
Me.Check42.Locked = True
End If
If Me.Check5 = True Then
Me.Frame5.Locked = False
Me.Check43.Locked = False
Me.Check44.Locked = False
Else
Me.Frame5.Locked = True
Me.Check43.Locked = True
Me.Check44.Locked = True
End If
If Me.Check6 = True Then
Me.Frame6.Locked = False
Me.Check45.Locked = False
Me.Check46.Locked = False
Else
Me.Frame6.Locked = True
Me.Check45.Locked = True
Me.Check46.Locked = True
End If
If Me.Check7 = True Then
Me.Frame7.Locked = False
Me.Check47.Locked = False
Me.Check48.Locked = False
Else
Me.Frame7.Locked = True
Me.Check47.Locked = True
Me.Check48.Locked = True
End If
End If
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Description
Me.Visible = True
Resume Exit_Form_Open
End Sub
Private Sub Frame1_AfterUpdate()
Me.usernameid = fOSUserName
If Frame1.Value = 3 Then
Me.datecapaapproved = Date
Me.approvedby = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcomments = Null
Me.rejectcomments.Enabled = False
ElseIf Frame1.Value = 4 Then
Me.datecapaapproved = Date
Me.approvedby = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcomments.Enabled = True
Else
Me.datecapaapproved = Null
Me.approvedby = Null
Me.rejectcomments.Enabled = False
End If
End Sub
Private Sub Frame2_AfterUpdate()
Me.usernameid = fOSUserName
If Frame2.Value = 5 Then
Me.dateapprovedRegulatory = Date
Me.usernameid = fOSUserName
Me.approvedbyRegulatory = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsRegulatory = Null
Me.rejectcommentsRegulatory.Enabled = False
ElseIf Frame2.Value = 6 Then
Me.dateapprovedRegulatory = Date
Me.approvedbyRegulatory = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsRegulatory.Enabled = True
Else
Me.dateapprovedRegulatory = Null
Me.approvedbyRegulatory = Null
Me.rejectcommentsRegulatory.Enabled = False
End If
End Sub
Private Sub Frame3_AfterUpdate()
Me.usernameid = fOSUserName
If Frame3.Value = 7 Then
Me.dateapprovedRD = Date
Me.approvedbyRD = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsRD = Null
Me.rejectcommentsRD.Enabled = False
ElseIf Frame3.Value = 8 Then
Me.dateapprovedRD = Date
Me.approvedbyRD = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsRD.Enabled = True
Else
Me.dateapprovedRD = Null
Me.approvedbyRD = Null
Me.rejectcommentsRD.Enabled = False
End If
End Sub
Private Sub Frame4_AfterUpdate()
Me.usernameid = fOSUserName
If Frame4.Value = 9 Then
Me.dateapprovedManuf = Date
Me.approvedbyManuf = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsManuf = Null
Me.rejectcommentsManuf.Enabled = False
ElseIf Frame4.Value = 10 Then
Me.dateapprovedManuf = Date
Me.approvedbyManuf = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsManuf.Enabled = True
Else
Me.dateapprovedManuf = Null
Me.approvedbyManuf = Null
Me.rejectcommentsManuf.Enabled = False
End If
End Sub
Private Sub Frame5_AfterUpdate()
Me.usernameid = fOSUserName
If Frame5.Value = 11 Then
Me.dateapprovedGMS = Date
Me.approvedbyGMS = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsGMS = Null
Me.rejectcommentsGMS.Enabled = False
ElseIf Frame5.Value = 12 Then
Me.dateapprovedGMS = Date
Me.approvedbyGMS = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsGMS.Enabled = True
Else
Me.dateapprovedGMS = Null
Me.approvedbyGMS = Null
Me.rejectcommentsGMS.Enabled = False
End If
End Sub
Private Sub Frame6_AfterUpdate()
Me.usernameid = fOSUserName
If Frame6.Value = 13 Then
Me.dateapprovedPurchasing = Date
Me.approvedbyPurchasing = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsPurchasing = Null
Me.rejectcommentsPurchasing.Enabled = False
ElseIf Frame6.Value = 14 Then
Me.dateapprovedPurchasing = Date
Me.approvedbyPurchasing = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsPurchasing.Enabled = True
Else
Me.dateapprovedPurchasing = Null
Me.approvedbyPurchasing = Null
Me.rejectcommentsPurchasing.Enabled = False
End If
End Sub
Private Sub Frame7_AfterUpdate()
Me.usernameid = fOSUserName
If Frame7.Value = 15 Then
Me.dateapprovedOther = Date
Me.approvedbyOther = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsOther = Null
Me.rejectcommentsOther.Enabled = False
ElseIf Frame7.Value = 16 Then
Me.dateapprovedOther = Date
Me.approvedbyOther = Nz(DLookup("Nameofuserid", "tblcloselist", "[UserID]=" & Chr(34) & Me.usernameid & Chr(34)), "")
Me.rejectcommentsOther.Enabled = True
Else
Me.dateapprovedOther = Null
Me.approvedbyOther = Null
Me.rejectcommentsOther.Enabled = False
End If
End Sub