Refreshing lists in combo boxes

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.
 
W

Wayne Morgan

You need to tell the combo boxes to requery.

Me.cboEmployeeType.Requery
Me.cboEmployee.Requery
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top