W
wdsnews
I'm trying to count the number of classes a student has in their "Student
Schedule" table as we enter more records for that student. Assuming the
records are entered in the order of the student's preference, then we can
set the "Preference" field to be equal to the number of records. But I'm
new to Access and it doesn't behave as I expect. I get runtime error
'2001', "You cancelled the previous operation". Perhaps I need some kind of
post or 'save record' command?
I've attached the following code to the event called AfterUpdate of a field
called [CourseNo] on a subform called sbfSchedule. The sbfSchedule is
nested in the People form. The error occurs between the two msgBox
commands. After I get past this error, the next goal is to assign
intClassCount to the [Preference] field.
Private Sub cboCourseNo_AfterUpdate()
Dim intClassCount As Integer
Dim strTemp As String
strTemp = MsgBox("Box1", vbInformation, "no message")
intClassCount = DCount("[Student ID]", "[Student Schedule]", "[Student ID]
= Form!People!ID")
strTemp = MsgBox("Here's the ClassCount " & intClassCount, vbInformation,
"intClassCount")
End Sub
The sbfSchedule is based on a table called [Student Schedule] with fields
called [ID], [Student ID], [Course ID], [Confirmed], [Preference].
thanks for your help. I'm learning fast.
Schedule" table as we enter more records for that student. Assuming the
records are entered in the order of the student's preference, then we can
set the "Preference" field to be equal to the number of records. But I'm
new to Access and it doesn't behave as I expect. I get runtime error
'2001', "You cancelled the previous operation". Perhaps I need some kind of
post or 'save record' command?
I've attached the following code to the event called AfterUpdate of a field
called [CourseNo] on a subform called sbfSchedule. The sbfSchedule is
nested in the People form. The error occurs between the two msgBox
commands. After I get past this error, the next goal is to assign
intClassCount to the [Preference] field.
Private Sub cboCourseNo_AfterUpdate()
Dim intClassCount As Integer
Dim strTemp As String
strTemp = MsgBox("Box1", vbInformation, "no message")
intClassCount = DCount("[Student ID]", "[Student Schedule]", "[Student ID]
= Form!People!ID")
strTemp = MsgBox("Here's the ClassCount " & intClassCount, vbInformation,
"intClassCount")
End Sub
The sbfSchedule is based on a table called [Student Schedule] with fields
called [ID], [Student ID], [Course ID], [Confirmed], [Preference].
thanks for your help. I'm learning fast.