Results 1 to 5 of 5
  1. #1
    ijlpr is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2021
    Posts
    4

    Outlook Mail comparison from two different forms

    Hi Team,

    We are having two forms(Form 1 and Sub Forms 1), need to compose mail with comparing different names of table field names.


    ie., Form 1 - Ms no
    Sub Forms 1 - Undergoing MS
    ( But both Ms no and Undergoing MS are same)


    On comparing both we need to get the email id from Sub Forms 1 and send mail in outlook.


    Below is the vba code am using to fetch the mail id from one table. With this below code, i need the above scenario

    =======Code=========
    Dim olApp As Object
    Dim olMail As Object
    Dim strPath As String
    Dim strLocation As String
    Set olApp = CreateObject("Outlook.Application")
    Set olMail = olApp.CreateItem(0)
    Dim strsubject As String
    Dim sMsgBody As String
    Dim a As String
    M = Me![Email id]
    'b = Me![Status Msg]

    a = Me![MS no]
    'MsgBox a
    T = Me![Title]
    'MsgBox T
    'SB = Me![Subandbranch]
    With olMail
    strsubject = "Received your manuscript for publication, www.ijpbs.net"
    sMsgBody = "Respected author,"
    sMsgBody = sMsgBody & "<br><br>"
    sMsgBody = sMsgBody & "Ref manuscript number MS: " & a & ""
    sMsgBody = sMsgBody & "<br><br>"
    sMsgBody = sMsgBody & "We have received your research/review article ď" & T & "Ē and the copy right form and would be categorized under " & SB & ". We have allotted manuscript number MS " & a & " for your article. For further correspondence, kindly use this manuscript number only. We would be sending your manuscript to our reviewer (Reviewer 1) for evaluation. We will send the acceptance decision within 7-10 working days"
    sMsgBody = sMsgBody & "<br><br>"
    .To = M


    .Subject = (strsubject)
    .HTMLBody = (sMsgBody)
    '.Attachments.Add "\\Dell-lptp\d\IJPBS process\Vol - 5, Issue 1\Downloads\Down1\link.txt"
    ' strLocation = "\\Dell-lptp\d\IJPBS process\Vol - 5, Issue 1\Downloads\Down1\MS " & a & " RAW.docx"
    '.Attachments.Add (strLocation)


    .Display
    End With


    Set olMail = Nothing
    Set olApp = Nothing
    ==================================================


    Kindly help me in this issue.
    Attached Thumbnails Attached Thumbnails Table-01.jpg  

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    1,316
    Use DLookUP() on the source for the subform, using the MsNo from the mainform ?

    GDPR obviously not in effect where you work

    I would also have Option Explicit at the top of ALL your module?
    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?search_query=debug+access+vba



  3. #3
    ijlpr is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2021
    Posts
    4
    Kindly anyone sort this for me

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    9,653
    The first sentence of the first response is what I would have suggested as well. Something wrong with that idea?
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    1,316
    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?search_query=debug+access+vba



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

Similar Threads

  1. Populate an Outlook e-mail template
    By jcc285 in forum Programming
    Replies: 1
    Last Post: 10-03-2019, 03:46 PM
  2. Creating DB to use e-mail service other than Outlook
    By VWSpeedyB in forum Programming
    Replies: 5
    Last Post: 01-16-2015, 04:03 PM
  3. How to e-mail from access to outlook
    By hogue@montana.com in forum Programming
    Replies: 5
    Last Post: 02-17-2012, 12:33 PM
  4. Old way: Outlook...New way: Google mail
    By pdx834 in forum Access
    Replies: 1
    Last Post: 03-08-2011, 04:42 PM
  5. Open Outlook & populate e-mail
    By NISMOJim in forum Forms
    Replies: 7
    Last Post: 10-09-2010, 01:01 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