listbox

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,
 
S

Steve Schapel

Fix,

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

- Steve Schapel, Microsoft Access MVP
 
S

Steve Schapel

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
 

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