Results 1 to 4 of 4
  1. #1
    Nooberd is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    2

    Send Email by referencing email field in selected records on continuous form

    Hi everyone. I think this one should be easy, but I haven't been able to find a specific example by searching online.



    I have a continuous form which filters records from a couple txt and combo boxes. One of the fields contains email addresses. What I want is to create a button which allows me to open an Outlook email and paste all of the SELECTED records' emails into the To: field.

    For example: Let's say I run a muffin business. The form allows me to filter my muffin sales to view # sold per customer by Muffin-Type and #Days since today (two txt boxes and a cmd button to apply the filter). The last field displayed is the email for each customer. I decide to filter down to Blueberry Muffins in the last 30 days, and get a list of 20 different customers. The top 3 customers have purchased 20, 15, and 14, so I want to select those lines and email all 3.

    The records show CustomerID, CustomerName, #Sold, State, and Email

    I want to be able to select the top 1, 2, 3, etc customers (using the normal records selection option), then click an "Email Customers" cmd button to open a new Outlook email, which automatically pastes their emails into the To: field, and have a Subject and Body already filled (maybe a message telling those customers that blueberry muffins are on sale).

    I hope there is a way to do this using the Record Selection on the left side, because I think it's easier for an end-user. But I would consider creating a Selected field as well. Any suggestions? I want to avoid VBA as much as possible, simply because I'm still learning the program, but I can apply it where needed. Remember: the only relevant field here is the Email field in the continuous form, where I want to copy several emails from the filtered query and paste them into a new Outlook email. (Access 2010)

    Thanks ahead of time for the help!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Records cannot be selected nonsequentially with the record selector. Yes, code can loop through sequentially selected records. A Selected field might be easier approach. Regardless, will need VBA to build the email address string.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Nooberd is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    2
    Quote Originally Posted by June7 View Post
    Records cannot be selected nonsequentially with the record selector. Yes, code can loop through sequentially selected records. A Selected field might be easier approach. Regardless, will need VBA to build the email address string.
    I figured as much. Thanks for looking. I think I vaguely understand what needs to happen here, but certainly welcome some advice on how to build the VBA from anyone who's feeling generous! I figure I will create a table with each email and Yes/No, then relate the two in the form. From there I think the macro should loop through to find "true" values (a 'for loop'?), take the email for each true value, and populate the to: string. I've worked with excel macros to open and fill outlook emails before, so I think I can figure that part out. It's just getting the emails to populate into the To: field that will be tough. Finally, I figure I need to reset the table's Yes/No field to all be No.

    If anyone has spare time, please feel free to show an example! I have never built a VBA macro from scratch, usually stealing someone else's example and modifying it as needed, but I understand a novice level of the structure. Thanks for looking. It's a good learning opportunity.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 09-14-2015, 07:24 AM
  2. Replies: 1
    Last Post: 12-22-2014, 09:21 PM
  3. Replies: 5
    Last Post: 05-07-2014, 09:25 AM
  4. Filter email field on continuous form gives error
    By Ruegen in forum Programming
    Replies: 7
    Last Post: 10-10-2013, 09:31 PM
  5. Replies: 4
    Last Post: 04-13-2011, 10:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums