I have created a dialog box using an Access form.
- The dialog box includes a list of committees, populated from a query.
- The first (hidden) column in the list box is the ID number, and the second column is the committee name.
- Selection of single or multiple committees in the list will enable the user to carry out further activities, such as e-mailing all members of the committee or printing a report showing all selected committees.
This part isn't the problem.
The dialog box can be opened from the main data entry form for the committee details, from which I can pass in the ID for the currently-displayed committee.
When I open the dialog box in this way, I would like the currently-displayed committe to be highlighted in the list box, but cannot work out which property of the list box needs to be set to do this.
Thanks and regards
I attach a demo.
The CommitteeID is passed using Openargs.
Then you need to loop through all the entries in the listbox and compare each of their IDs with the value retrieved from OpenArgs.
(I find the code for dealing with multiselect list boxes very hard to remember. I need to look it up somewhere every time I want to use them.)
Many thanks, John - Should have guessed I'd need to loop through to set it, as that's what I'll be doing to identify selected items on closing the dialog box.