I am building a database in MS Access that is being used by employees to log daily entries, access customer information, etc. The 2 major functions of the database is a Distro (replacing an old Excel Distro Matrix) and a custom Email Report Function.
The Email Report Function is designed to open a new message in Outlook and automatically generate fields such as To, CC, Subject Line, and Message Body. The Button itself is located on a form, where the employees do not interact with the tables of the Database themselves, and can simply select from a list of Reports in a combo box, and click "Email Report".
My question is complicated because of the structure of my database. The combo box is a list of Reports that are sent out on a daily basis, and unable to be edited by the user. The Distro is a table that is structured as follows: Person / Entity (Name), Contact Information (Email Address), and the rest of the columns are the Report Types that hold a True / False check box. Ultimately, each receiving person is listed by name, contact email, and according to what reports they recieve they have checked box under each report column.
I need to design a function that does the following: Checks what report is selected from the combo box on the form, open a new email in Outlook, query the Distro Table for who is checked to recieve the selected report, and finally, collect those specific email addresses and insert them into the message in the correct location (To, CC) while also generating the Email Subject line and Message Body according to what report has been selected from the original combo box.