1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Email Button to send email in a form access 2010

Discussion in 'Business Applications' started by nickblitz, Oct 29, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. nickblitz

    nickblitz Thread Starter

    Joined:
    Oct 29, 2012
    Messages:
    12
    ok, this code below is working but it does not show a pop up from outlook instead it sends the mail automatically.

    I want to have a pop up as a new email message with the to list populated from the query when i click the button on the form. anyone can help?

    Code:
    Code:
    Dim MyDb As DAO.Database
    Dim rsEmail As DAO.Recordset
    Dim strEmailAddress
    
    Set MyDb = CurrentDb()
    Set rsEmail = MyDb.OpenRecordset("Query Full Director", dbOpenSnapshot)
    
    Do Until rsEmail.EOF
      strEmailAddress = strEmailAddress & rsEmail("Email") & ";"
      rsEmail.MoveNext
    Loop
    
    strEmailAddress = Left(strEmailAddress, Len(strEmailAddress) - 1)
    
    DoCmd.SendObject , , acFormatRTF, strEmailAddress, _
    , , strSubject, strEMailMsg, False, False
    
    rsEmail.Close
    Set rst = Nothing
    
     
  2. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,814
    Use
    DoCmd.SendObject , , acFormatRTF, strEmailAddress, _
    , , strSubject, strEMailMsg, True, False
     
  3. nickblitz

    nickblitz Thread Starter

    Joined:
    Oct 29, 2012
    Messages:
    12
    thank you!! it worked! (y)(y)

    what does the true and false at the end means actually?
     
  4. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,814
    I think it is whether or not to use a "Template".
     
  5. nickblitz

    nickblitz Thread Starter

    Joined:
    Oct 29, 2012
    Messages:
    12
    how about editing the code to make it skip blank fields? :)
     
  6. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,814
    VBA can do it, but not using the code that you have.
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1074550

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice