List box used to display varying data?

Asked By G James
03-Nov-09 12:19 PM
Earn up to 0 extra points for answering this tough question.

Hi, I hope I can explain this properly.

I have a switchboard page for searching records in my database, and on this page, there are several selections for searching, such as: By Committee, By Cost Centre, By Status, etc.  When the user selects any of these options, I want the related table values to appear in a list box that is also on the same switchboard page.  So for Committee, I want the list box to display the value of the Committee table that I have previously created, which has 35 committees available.  However, I would like the list box to remain blank until the user selects the search criteria, which they would do by clicking on a command button.  Then I want the list box to populate the values.

Can this be done, and if yes, how would I do it?

Any help would be greatly appreciated.  Thanks in advance!

G

  Unbound List Control

Dean Lavell replied to G James
03-Nov-09 08:02 PM
You want to create an unbound rowsource (nothing assigned to the rowsource property) list box control and assign the rowsource using VBA. Create each of the queries that answer each of the combo boxes. Then for each of the combo boxes' After Update event assign the appropriate query to the list boxes' rowsource.

As an example, say you made a query called Committees selecting the info you want in the list box. I will call the list box lstSelectValue and the committee combo box cboCommittee. Then in the cboCommittee combo box After Update event put:

Me.lstSelectValue.Rowsource = "Committees"

Hopefully you have basic VBA skills to accomplish the above. Let me know if not.

  Worked perfectly!

G James replied to Dean Lavell
04-Nov-09 08:12 AM

Thanks so much Dean!  That worked exactly as I imagined it.  I really appreciate your help.

G

Create New Account