Filter records from a combo box

B

brian b

I found the following on the Access Web:

To filter records in a combo/listbox based on the value selected in another
combo/listbox, you can use a stored query which uses the first control's
value as a parameter. For example,

Select PeopleID, PeopleName from tblPeople Where PeopleID =
Forms!FormName!NameOfFirstControl;

Then all you need to do is issue a Requery on the second combo/listbox in
this first control's AfterUpdate event.

Private Sub NameOfFirstControl_AfterUpdate()
Me!NameOfSecondControl.Requery
End Sub

This works fine when I use the Mouse to move around my form. When I tab
from the first combo box, I lose the filtered records in the second combo
box. What gives?
 

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

Similar Threads


Top