Results 1 to 4 of 4
  1. #1
    Hamill is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    2

    Email on button Click

    Hi



    I am an absolute bunny with access but I have created a database where staff fill out a form to apply for leave and when they press a button I would like an email to be sent to me (the boss!) so I can open up the form and approve the leave. The email will be exactly the same each time as it is just a flag for me to open up the database. I am using access 2016. I have looked and some people use a send email macro but I cannot seem to see that one in my database

    Can someone help

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    docmd.SendObject acSendreport ,"rpt2Email",acformatPDF,txtTo,,,txtSubj,txtMessag e

  3. #3
    Hamill is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    2
    Thanks (I think) As I said I am a bunny at access and have copied the above into a module and changed the to the following but if gets grumpy and says compile error (email address is not real at the moment)

    I don't to actually send anything except a statement in the subject : "Leave application has been submitted" to john@hamilton.kiwi

    The following is what I tried and got an error - keeps on highlighting the word hamilton


    docmd.SendObject acSendreport ,"rpt2Email",acformatPDF,john@hamilton.kiwi,,,Leave application has been submitted,Leave application has been submitted

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Most arguments are strings. Try

    docmd.SendObject acSendreport ,"rpt2Email",acformatPDF,"john@hamilton.kiwi",,,"Leave application has been submitted","Leave application has been submitted"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 9
    Last Post: 03-31-2015, 04:13 PM
  2. Replies: 1
    Last Post: 09-07-2014, 10:15 PM
  3. Replies: 5
    Last Post: 05-07-2014, 09:25 AM
  4. Replies: 4
    Last Post: 02-01-2014, 07:56 PM
  5. Replies: 1
    Last Post: 03-15-2012, 05:41 PM

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