Hi Gmenon,
Yes, it's possible. You seem to wish to mimic the windows' task bar. I can
think of many ways of doing this but the critical thing is to compile a list
of loaded forms (and reports?) and keep this list up-to-date.
If you want to do a one-time survey of the application then I suggest you
read through the AllForms (AllReports) collection that is a member of the
CurrentProject object and test each form's IsLoaded property. However this
only provides a snapshot whereas users can load and close forms at will
throughout the session.
So you need a flexible 'container' into which you can place a form's details
(name) when it is loaded and from which you can remove the details when it is
closed, remembering to update your visible control each time such an event
occurs. Two such 'containers' suggest themselves: a collection and a table.
(Hm! Also maybe directly into the rows of your combo box or list box? Bit
messy but perfectly feasible.)
If you are not familiar with objects then ignore the collection route and
concentrate on a table based solution. Anyway tables are very easy to bind
to combo boxes, list boxes or continuous forms and the controls or forms
themselves are easy to requery.
OK the strategy is:
Bind your visible control to the table.
Every time a form is loaded, add a record to your table and requery your
control.
Every time a form is closed, delete the appropriate record from your table
and requery your control.
When a user clicks on a row (or highlights the rows and presses the required
key combination) activate the appropriate form. (Your list needs to be modal
so that it is always on top.)
Personally I would have only two attributes in my table: ObjectRef and
FormName. ObjectRef is a long integer and holds the object reference of the
form in question. Capture this value by using something like SET ObjectRef =
Me in the OnLoad event of the form.
Sorry this has turned out to be more confused than planned as I thought of
more and more things as I was writing. Make some more decisions as to how
you want this to work and look and we can explore the solution in more detail.
Regards,
Rod