linking combo box and list box

Leonora D. Mendoza

New member
Local time
Today, 11:13
Joined
Sep 12, 2001
Messages
5
I want to show all my documents in th elist box when I click a document type in my combo box.How can I do that? Is there any formula on how to get it?
also the total number of documents per document type
 
Lets say you have Table1 with the Fields DocType and Document.
Make a query based on Table1. Lets call it Query1.
Activate the Totals by right clicking while in the design view then clicking totals.
Set the Total: for DocType to Group By and Document to Count.

On your form, say Form1, containing a combo box and a list box, set the Row Source of the combo box to Query1.
To get both the DocType and number of documents to display, column count should be 2, column widths say 1”;1” and Bound Column =1.

Now you want another Query, say Query2, also based on Table1.
Untick the Show for DocType, and set the Criteria to
Forms![Form1]![Combo1]

Now set the Row Source for your list box to Query2.

Lastly go back to your combo box, and for the On_Change Event, add the following code.

Forms!Form1!List1.Requery

If it doesn’t make sense, I can email you the db.
 

Users who are viewing this thread

Back
Top Bottom