Full Version: User Controlled Distribution List
UtterAccess Discussion Forums > Microsoft® Access > Access Macros
apuntch123
I have a couple of databases that email reports via a macro or VBA using the SendObject command. The names of the recipients are keyed into one of the two and it is ran by the user to send their reports. However, we often need to make changes to the recipient names and only someone authorized to design view of the macro or code can change those names. Is there some way to show a macro in design view so that each user can maintain their own distribution lists?
ScottGem
You shouldn't be hardcoding the names. Set up a table that has the names and reference that table in your code.

Then all you need is a form to maintain the table.
apuntch123
That's the scenerio I would like to create. How would you reference the table field using the SendObject command or would you set it up differently?
ScottGem
There are a few ways. The way I would probably do it is to set up a multiselect list box where the user can select the names to sdend to. Then you can concatenate the selected names and use that as your To parameter. See multiselect listbox in the Forms section at www.mvps.org/access for details on how to concatenate the names.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.