List box

P

Playa

I have a form with a combo box and list box. When I select a department from
the combo box I want all the machine numbers from that department to be in
the list box. Right now all the machine numbers are in the list box but I
would like only the machine numbers that are in the department that is in the
combo box to be shown. I have no idea how I would go about doing this. Any
suggestions?

Thanks in Advance
 
M

Mike Elliott

You are going to have to Use the Change Event for the Combo box to reset the
Source for the ListBox.

Just create a variable in your Combo box Change event and build the
appropriate SQL statement based on the value in the combo box (Copy and Past
the from the rowsource of your current listbox to get started).

Last, just set the Listbox.RowSource to the variable you just built.

Mike
 

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