Sub Form Requery

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form with a combo box on it called cboIncident. I also have a
listbox on the form called "trainee" that is populated by a query. I want
the listbox to requery every time I change the value in the combo box. The
listbox query selects all individuals that have the same Incident ID as the
value from the combo box. Any help would be greatly appreciated. Thanks.
 
Create an AfterUpdate event procedure for cboIncident as follows:

In the properties window for cboIncident, select the Event called After
Update, click the builder button (...), and select Code Builder.

Enter the following line of code:
Me!trainee.Requery

Jerry
 
Jerry Porters suggestion did not work. It either didn't requery or refresh
the listbox to show the new results. Any Other ideas?
 
Bill,

This is a very common technique, and I've used it quite a lot. If it's
not working, then there's something simple missing in your
implementation or in my understanding of the situation or in my
explanation.

The code window should look something like:

Private Sub cboIncident_AfterUpdate()
Me!trainee.Requery
End Sub

If you're familiar with the Access debugging tools, I would suggest
putting a break point on the line of code with the Requery command.
Then see if it is executing when you change the value in the combo box.

Jerry
 
Back
Top