refresh

  • Thread starter Thread starter John MilburySteen
  • Start date Start date
J

John MilburySteen

Hi Access Gurus,

In A2003 I have a form (called Students) containing a subform (called
Classes). These are the classes that a given student is enrolled in. In
the Classes subform there is a field called Class. This field contains a
pulldown of possible classes to choose and in the pulldown beside each class
is the number of students enrolled already. This makes it easy for a user
to assign a student to the smaller section of a class to keep the numbers
more or less equal. A query generates the totals in the pulldown.

I cannot find a way to make the query run again to refresh the totals on the
pulldown after a student has been added to a class. On the top menu,
Records --> Refresh works fine, but I need a macro to refresh the totals On
Update.
I have tried a macro that calls requery and repaint, but requery and repaint
Class doesn't work. What to do?
 
John,

If you are using the After Update event of the Class combobox, this is
probably too early for the recalculation to be done. The reason for this is
that the new enrolment has not yet been saved to the table.

You could put a RunCommand/SaveRecord action at the beginning of the macro.
This should work, as long as there are no validation rules or whatnot that
still need to be satisfied before a valid record can be created. After
that, a Requery of the combobox should do the trick I think.
 
You were right with RunCommand. RunCommand Refresh After Update event did
the trick. Many thanks.
 
Back
Top