Results 1 to 3 of 3
  1. #1
    CP611 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    55

    VBA Code for sending emails via Outlook

    I'm trying to write a code with no experience of writing code following a You Tube video to send emails via Access and Outlook. I have the below code but keep getting the error code Expected: line number or label or statment or end of statment when I write in the second line. I basically want it to look like this



    To User123
    You have entered the below form on 03/11/2023
    (details of entry)

    Msg = "To " & AddedBy & ",<P>"
    "You have entered the below form on " & TransactionDate & ",<P>"

    Thank you!

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    And just where exactly are you writing this?

    As it stands, it is complete nonsense.

    Please supply the link that got you started on this.

    Perhaps look at the examples here.
    https://learn.microsoft.com/en-us/of...cmd.sendobject
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    CP611 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    55
    Hi there thank you for replying, I was using this video (https://www.youtube.com/watch?v=s-Z0LHgipVE) but I managed to get it to work in the end!

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

Similar Threads

  1. Replies: 10
    Last Post: 03-20-2022, 05:34 AM
  2. Replies: 12
    Last Post: 05-03-2020, 12:16 AM
  3. Sending Outlook Emails from form in Access 2007
    By IncidentalProgrammer in forum Programming
    Replies: 4
    Last Post: 01-09-2015, 11:06 AM
  4. Sending Emails from Access via Outlook
    By Terry Lawson in forum Programming
    Replies: 3
    Last Post: 11-14-2014, 10:03 AM
  5. Sending several emails causes Outlook crash
    By mercapto in forum Programming
    Replies: 3
    Last Post: 06-14-2013, 07:30 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