Hi,
I have a few fields in a form and a corresponding table. The first element of a form is a combo box. Based on the selection, the "Course Sequence" field is being populated based on another field. Where I'm stuck is the third field which is supposed to get a MAX of type of courses of a type selected in the combo box.
I've attached the db file but just for reference, the concept is as follows:
The table is:
These are manually typed in a table but If I were to use the form now adding another cohort of learners and choose LAIM in the combobox, eg. 1234, the Course Sequence would be automatically populated as "AB" but I'm at a complete loss how to find MAX(Count) Where CourseSequence = AB (if any of the instances of AB alredy exist) and add 1 to it so it becomes AB 4. If there are no instances of that particular CourseSequence it'd just be 1.
So far I've added the On Change Event to the LAIM combo box (cmbLaim) to update the Code Sequence field (txtBoxCodeSequence on the form)
Please advise. Hope that makes sense.
I have a few fields in a form and a corresponding table. The first element of a form is a combo box. Based on the selection, the "Course Sequence" field is being populated based on another field. Where I'm stuck is the third field which is supposed to get a MAX of type of courses of a type selected in the combo box.
I've attached the db file but just for reference, the concept is as follows:
The table is:
Code:
LAIM | CourseSequence | Count
1234 | AB | 1
1234 | AB | 2
4321 | AC | 1
1234 | AB | 3
These are manually typed in a table but If I were to use the form now adding another cohort of learners and choose LAIM in the combobox, eg. 1234, the Course Sequence would be automatically populated as "AB" but I'm at a complete loss how to find MAX(Count) Where CourseSequence = AB (if any of the instances of AB alredy exist) and add 1 to it so it becomes AB 4. If there are no instances of that particular CourseSequence it'd just be 1.
So far I've added the On Change Event to the LAIM combo box (cmbLaim) to update the Code Sequence field (txtBoxCodeSequence on the form)
Code:
Private Sub cmbLaim_Change()
Me.txtBoxCodeSequence.Value = Me.cmbLaim.Column(0)
End Sub
Please advise. Hope that makes sense.