make a form, this form is a SINGLE RECORD form connected to the company table, tCompanies. (use the wizard).
now on the form, put a listbox.
The listbox is connected to a query, say, qsCo. this query pulls the list of Comanies and their ID only. select COname, CoID from tCompanies.
set the name of the listbox , lstCO (in the property NAME)
set number of columns, column count = 2
Set the listbox columnwidths to: 3;0. (so the ID is hidden)
set the listbox.boundcolumn = 2. (the ID) user will select 1 of the comanies in the list. Then the form will filter on ONLY that company.
in form design, select the list box. in the event: AFTERUPDATE (of the list box) put this filter code:
Code:
Private Sub lstCO_AfterUpdate()
Me.Filter = "[coID]=" & lstCo
Me.filterOn = True
End Sub
user will select from the list, this company will now filter.
to go back to seeing ALL companies in the form, click the APPLY FILTER icon at the top menu bar (turns filter off)