Cascading list box

G

Guest

Greetings everyone. I am using Access 2003. I am trying to make a series of
cascading list boxes but I can not get it to work. Assuming I have listbox1
and listbox2 I am not sure about the code. This is what I have tried:

Private sub listbox1_afterupdate
me.listbox2.rowsource = "SELECT table.field2 " & _
"FROM table " & _
"WHERE table.field1 = '" & listbox1.value & "' " & _
"ORDER by table.field2;"
me.list2.requery
exit sub

I have tried to put this in both the after update and click event of
listbox1. At this point I am thinking maybe listboxes do not have "values",
but maybe some other way to distinguish what is highlighted maybe like an
option group? Basically I want my listbox2 to only display values
corresponding to the value chosen in listbox1. Any ideas? Thank you.
 

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