I have a form where I need to select a business from first listbox then display the contacts for the business in the second listbox.
I've been looking at cascading listboxes / combo boxes but everything I've found so far does not fit my requirements as its usually based around a single field being displayed in a list / combo.
My senario is this:
My first listbox displays:
Business Name, Address line 1, city, business type
then hidden is the unique key (ID) for that business.
This is done by using a query as its row source and display all the relevent business I require.
My second Listbox displays:
Full name, Job title
then hidden is a unique key (ID) .
When one of the businesses is selected all the contacts that have the business ID assigned to them need to be displayed in the second list box.
I've created a Query (for the second listbox) and works when I manually give the query a business ID (to filter the contacts) but cannot seem to get the query to use the 'first listbox' selection.
I've tried to build the critieria in the query and can get as far as selecting the first list but do not know how to get it to select the correct column/field with the ID in?
I have a 'requery' procedure for the 'second listbox' on the event 'after update' (I've also tried 'on click' too) to try and run the query in the second listbox.
I've been looking at cascading listboxes / combo boxes but everything I've found so far does not fit my requirements as its usually based around a single field being displayed in a list / combo.
My senario is this:
My first listbox displays:
Business Name, Address line 1, city, business type
then hidden is the unique key (ID) for that business.
This is done by using a query as its row source and display all the relevent business I require.
My second Listbox displays:
Full name, Job title
then hidden is a unique key (ID) .
When one of the businesses is selected all the contacts that have the business ID assigned to them need to be displayed in the second list box.
I've created a Query (for the second listbox) and works when I manually give the query a business ID (to filter the contacts) but cannot seem to get the query to use the 'first listbox' selection.
I've tried to build the critieria in the query and can get as far as selecting the first list but do not know how to get it to select the correct column/field with the ID in?
I have a 'requery' procedure for the 'second listbox' on the event 'after update' (I've also tried 'on click' too) to try and run the query in the second listbox.