DoCmd.Close acForm, “frmAnswerIdsToElts” DoCmd.Close acForm, “frmAnswerIds” DoCmd.GoToRecord acDataForm, “Employees”, acGoTo, 7 Me!txtRoles = “” Dim AllRoles As Integer ‘ initialiseer AllRoles If IsNull(Me!Roles) Then ‘ waarde Roles control v.h. formulier AllRoles = 0 Else AllRoles = Me!Roles End If Dim rst As New ADODB.Recordset ‘ open de tabel rst.Open "tblProjectRoles", CurrentProject.Connection, adOpenKeySet, adLockOptimistic ‘ ga naar het eerste record rst.MoveFirst Do While Not rst.EOF ‘ stop bij end of file ….. ….. ‘ ga naar het volgende record rst.MoveNext Loop Dim rst As New ADODB.Recordset, strRoles As String strRoles = “” rst.Open "tblProjectRoles", CurrentProject.Connection,adOpenKeySet, adLockOptimistic rst.MoveFirst ‘ check the roles specified by Roles Do While Not rst.EOF If rst!roleId And Me!Roles Then ‘ And: bitwise and van de operanden strRoles = strRoles & rst!rolename & “;” End If rst.MoveNext Loop rst.Close ‘ sluit de recordset (table) If Not IsNull(Me!Role.Column(1)) , Then strRole = Me!Role.Column(1) & “; “ ‘ rol geselecteerd Else strRole = “” End If IsIncluded = Role And AllRoles If Not IsIncluded Then ‘ voeg rol toe als die nog niet in AllRoles zit Me!Roles = AllRoles + Role strRoles = strRoles & strRole Me!txtRoles = strRoles End If Sub CalculateRoles(AllRoles As Integer, strRoles As String) MsgBox(“Please select a project member first!”) Me!Date.Requery datesame = (Year(rst!Date) = Year(Me!Date)) datesame = datesame And (Month(rst!Date) = Month(Me!Date)) datesame = datesame And (Day(rst!Date) = Day(Me!Date)) response = MsgBox(“new interview?”, vbYesNo) If response = vbYes Then rst.AddNew rst!PersonnelId = Me!PersonnelId rst!Date = Me!Date Me!InterviewId = rst!InterviewId rst.Update [Forms]![frmStartInterview]![PersonnelId] Function Included(ToCompare As Integer, Mask As Integer) Included = ToCompare And Mask End Function [Forms]![frmStartInterview]![PersonnelId] Included([tblProjectMembers]![Roles],[tblQuestions]![Roles]) ([Forms]![frmStartInterview]![begin] And [tblQuestions]![begin]) Or ([tblQuestions]![during] And [Forms]![frmStartInterview]![during]) Or ([Forms]![frmStartInterview]![end] And [tblQuestions]![end]) [Forms]![frmStartInterview]![InterviewId] Private Sub EnterAnswer() Dim Found As Boolean, rst As New ADODB.Recordset rst.Open "tblAnswers", CurrentProject.Connection, adOpenKeyset, adLockOptimistic Found = False If Not (rst.EOF And rst.BOF) Then rst.MoveFirst Do While Not rst.EOF And Not Found Found = (rst("interviewId") = Me!interviewId) And (rst("QID") = Me!QID) If Not Found Then rst.MoveNext Loop End If If Not Found Then rst.AddNew rst("QID") = Me!QID rst("interviewId") = Me!interviewId End If rst("Answer") = Me!Answer rst("answerelement") = Me!cmbAnswer rst.Update rst.Close End Sub Private Sub Form_Open(Cancel As Integer) Dim cat As New ADOX.Catalog, usr As User, grp As Group Me!cmdAnswersToElements.Visible = False cat.ActiveConnection = CurrentProject.Connection With cat For Each usr In .Users If usr.Name = CurrentUser Then For Each grp In usr.Groups If grp.Name = "Admins" Then Me!cmdAnswersToElements.Visible = True End If Next grp End If Next usr End With End Sub For Each grp In .Users(CurrentUser).Groups If grp.Name = "Admins" Then MsgBox ("Is Admin") Next grp For Each usr In .Groups("Admins").Users If usr.Name = CurrentUser Then MsgBox ("Is Admin") Next usr