listbox

  • Thread starter Thread starter fix
  • Start date Start date
F

fix

Hello,

I'm trying to create a form with 2 listboxes. In the first listbox I
want to select eg 'the name of the mother' and in the second listbox I
want to be able to get a list of 'all the childeren that belong to that
mother', so it displays a selected set of records.

My current result is that I get al list of all the childen of every
mother when I select a mother (first listbox) and jumps automaticaly to
the first record (second listbox) where the mother is equal, but it
still keeps showing all the other childeren.
I'm using the folowing code for it:

Private Sub listbox1_AfterUpdate()
2 =
End Sub


Can anyone help thnx in advance,
 
Fix,

Private Sub listbox1_AfterUpdate()
Me.listbox2.Requery
End Sub

- Steve Schapel, Microsoft Access MVP
 
Fix,

What's actually happening?

I made an assumption that your queries are set up correctly. The
RowSource of listbox2 has to have a reference to listbox1 in the
criteria of the applicable field, using syntax such as...
[Forms]![NameOfYourForm]![listbox1]
Is this what you've got?

- Steve Schapel, Microsoft Access MVP
 
Back
Top