Move an Object from Form Detail to Header in Code

I use the subform method suggested by MajP
Just to reiterate one more time so that others do not miss the purpose of that post. That demo was NOT meant to demonstrate navigation controls. It is to demonstrate different ways to centralize and encapsulate your code. The navigation buttons was just for demonstration.
A third and most common method would be to put the methods in a standard module and pass the form reference.

Here is a more advanced version demonstrating the subform concept that uses a subform to act as a single control. A From To List. It is demoed on many forms doing different things. But the code is written once in the subform.
There is a lot going on. The buttons enable and disable as appropriate. You can select one item or all items. Use the buttons or double click. If you want this functionality to pick from a list simply drop the subform on any form. Then pass in the recordsource for the listbox/s.
FromTo.jpg


DISCLAIMER. This demo is to demonstrate the concept of encapsulating functionality of multiple controls within a subform. Then being able to drop the subform on to any form and use the functionality. It is not intended to demonstrate the best method to create a From To List type control.
 

Attachments

Users who are viewing this thread

Back
Top Bottom