L
Lorien2733
I am trying to put together a registration form for summer classes. The
student puts in all info required and selects the courses they'd like to take
from a combo box. There are four class periods so they can take up to four
classes. The form calculates tuition, fees etc and prints just like it's
supposed to. So far so good. Once all the students have registered and we
know how many kids we'll have for each subject, the clerks will go back and
determine how many classes will be needed for a particular subject and assign
rooms, times and teachers - creating the actual course schedule. This
schedule is entered in a ScheduleTable. Once the schedule is set, the clerks
go back to the Registration form to assign individual students to their
classes. There are buttons on the Reg. form, next to the subject combo boxes.
They click the button and a box pops up(ScheduleDetail1-4) showing all the
classes in the ScheduleTable that match that subject. This all works fine.
Never knowing when to leave well enough alone, I thought it would be nice to
show the clerks a count of how many students have been assigned to the
classes. I added a field to the pop-up form called ClassCnt and I have a
query that consolidates my four periods and I thought all I had to do was a
simple DCount but I can't get it to work.
The query runs On Open of the pop-up and the control source of ClassCnt is
=DCount("*","ClassRosterConsolidated","[class]=FORMS!ScheduleDetail1![ClassNo]")
The really strange thing is that if I click in my ClassCnt box, the correct
count shows up. If you don't click in the box, it's empty. I figure that
means I've got my code firing in the wrong event. I've tried every putting my
DCount in every On Open, On current, Got Focus etc. that I can find. I even
tried moving focus to the ClassCnt but nothing works. What am I doing wrong
here?
TIA
Lynne
student puts in all info required and selects the courses they'd like to take
from a combo box. There are four class periods so they can take up to four
classes. The form calculates tuition, fees etc and prints just like it's
supposed to. So far so good. Once all the students have registered and we
know how many kids we'll have for each subject, the clerks will go back and
determine how many classes will be needed for a particular subject and assign
rooms, times and teachers - creating the actual course schedule. This
schedule is entered in a ScheduleTable. Once the schedule is set, the clerks
go back to the Registration form to assign individual students to their
classes. There are buttons on the Reg. form, next to the subject combo boxes.
They click the button and a box pops up(ScheduleDetail1-4) showing all the
classes in the ScheduleTable that match that subject. This all works fine.
Never knowing when to leave well enough alone, I thought it would be nice to
show the clerks a count of how many students have been assigned to the
classes. I added a field to the pop-up form called ClassCnt and I have a
query that consolidates my four periods and I thought all I had to do was a
simple DCount but I can't get it to work.
The query runs On Open of the pop-up and the control source of ClassCnt is
=DCount("*","ClassRosterConsolidated","[class]=FORMS!ScheduleDetail1![ClassNo]")
The really strange thing is that if I click in my ClassCnt box, the correct
count shows up. If you don't click in the box, it's empty. I figure that
means I've got my code firing in the wrong event. I've tried every putting my
DCount in every On Open, On current, Got Focus etc. that I can find. I even
tried moving focus to the ClassCnt but nothing works. What am I doing wrong
here?
TIA
Lynne