T
tclarke
I have a Microsoft Acess 2003 database which has a form, ExamFrm, whose
record source is a table, StudentTbl (PK = StudentID), and a sub form
ExamSubform (continuous forms), whose record source is a table, ExamTbl
(PK = ExamID).
The form displays student details (from StudentTbl)i.e txtName
comboL1Pass, comboL2Pass, comboL3Pass etc at the top and exam results
(from ExamTble displayed as continuous forms) i.e. txtModuleID,
chbxPass etc for each of eight exam modules.
In order to pass L1 the student must pass modules 1, 2 and 7.
At the moment I inspect the sub form and use the combo box comboL1Pass
to enter either PASS or FAIL manually, depending on the results.
Is it possible to get the form to search the sub form and automatically
display either Pass or Fail, depending on the results in the sub form?
I've tried (without success):-
Private Sub Form_AfterUpdate()
If Me.Exam_details_Subform.[txtModuleID] = 1 And _
Me.Exam_details_Subform.[chbxPass] = True And _
Me.Exam_details_Subform.[txtModuleID] = 2 And _
Me.Exam_details_Subform.[chbxPass] = True _
And Me.Exam_details_Subform.[txtModuleID] = 8 And _
Me.Exam_details_Subform.[chbxPass] = True Then
Me.comboL1Pass = "PASS"
Else
Me.comboL1Pass = "Fail"
End If
End Sub
N.B.
I do have a query, PassedLevelOneQry, which displays all the required
details for students who have passed Level 1 and this works OK. As an
alternative, is there any way to display the result of this query in
comboL1Pass?
Terry
record source is a table, StudentTbl (PK = StudentID), and a sub form
ExamSubform (continuous forms), whose record source is a table, ExamTbl
(PK = ExamID).
The form displays student details (from StudentTbl)i.e txtName
comboL1Pass, comboL2Pass, comboL3Pass etc at the top and exam results
(from ExamTble displayed as continuous forms) i.e. txtModuleID,
chbxPass etc for each of eight exam modules.
In order to pass L1 the student must pass modules 1, 2 and 7.
At the moment I inspect the sub form and use the combo box comboL1Pass
to enter either PASS or FAIL manually, depending on the results.
Is it possible to get the form to search the sub form and automatically
display either Pass or Fail, depending on the results in the sub form?
I've tried (without success):-
Private Sub Form_AfterUpdate()
If Me.Exam_details_Subform.[txtModuleID] = 1 And _
Me.Exam_details_Subform.[chbxPass] = True And _
Me.Exam_details_Subform.[txtModuleID] = 2 And _
Me.Exam_details_Subform.[chbxPass] = True _
And Me.Exam_details_Subform.[txtModuleID] = 8 And _
Me.Exam_details_Subform.[chbxPass] = True Then
Me.comboL1Pass = "PASS"
Else
Me.comboL1Pass = "Fail"
End If
End Sub
N.B.
I do have a query, PassedLevelOneQry, which displays all the required
details for students who have passed Level 1 and this works OK. As an
alternative, is there any way to display the result of this query in
comboL1Pass?
Terry