Refreshing lists in combo boxes

  • Thread starter Thread starter E. Jordan
  • Start date Start date
E

E. Jordan

I have a form that displays "Department"; "Employee Type";
and "Employee" fields, which control the output of a
query. The employee types are not constant and therefore
must be derived through queries (or make tables), rather
than fixed tables. The form is structured with macros
that update the underlying queries in accordance with this
heirarchy.

E.G. When "Department" is updated, both the "Employee
Type" and "Employee" queries are refreshed to reflect the
changes using event macros.

Assuming the user updates the form sequentially ('Dept'
then 'Sub Dept' then 'Employee'), this works. However,
when the user works out of order or goes back to a higher
level field (e.g. changes departments after
displaying 'Employee Types') the source list does not
reflect the changes to its underlying query, meaning that
the 'Employee Types' for department 'A' will appear for
department 'B'.

Is there any way to instruct the form to refresh its lists
from within a Macro without closing and reopening the form?

I'm using Access 97 and have very limited VB knowledge.
Thanks in advance for any help.
 
You need to tell the combo boxes to requery.

Me.cboEmployeeType.Requery
Me.cboEmployee.Requery
 
Back
Top