Results 1 to 15 of 15
  1. #1
    Naja is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2020
    Posts
    16

    Event Procedure for email

    Hello!

    I have the below question. Thanks in advance.


    Click image for larger version. 

Name:	Email issue.jpg 
Views:	20 
Size:	66.1 KB 
ID:	43372

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    The certificate url is part of the data set (recordsource) of your form? Then concatenate that field also.
    So little info...

    I would think you'd want that in the body, not subject line. Email app might not like that.
    If you expect the url to be clickable, you should specify the output format unless you know for a fact that the default would be html, which I would not expect.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Presuming it's on the form somewhere, this type of thing:

    "Your certificate..." & Me.TextboxName & " more text here if desired"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Naja is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2020
    Posts
    16
    Yes is part of the database.

  5. #5
    Naja is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2020
    Posts
    16
    Quote Originally Posted by pbaldy View Post
    Presuming it's on the form somewhere, this type of thing:

    "Your certificate..." & Me.TextboxName & " more text here if desired"
    Thank you for your input. I was able to put it on the email body text. This is how I did it.

    Private Sub Command33_Click()
    DoCmd.SendObject acSendNoObject, , , Me.Combo36.Value, , , "Your Certificate Is Coming Up For Renewal " & [EndDate], "Please let me know if you are renewing your certificate " & [CommonName], True
    End Sub

    But I also want to add this statement on a separate line:

    Please provide the CSR to proceed with the renewal.

    Thanks
    Naja

    How do I add that statement on a separate line.

  6. #6
    Naja is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2020
    Posts
    16
    Quote Originally Posted by pbaldy View Post
    Presuming it's on the form somewhere, this type of thing:

    "Your certificate..." & Me.TextboxName & " more text here if desired"
    Thank you for your input. I was able to put it on the email body text. This is how I did it.

    Private Sub Command33_Click()
    DoCmd.SendObject acSendNoObject, , , Me.Combo36.Value, , , "Your Certificate Is Coming Up For Renewal " & [EndDate], "Please let me know if you are renewing your certificate " & [CommonName], True
    End Sub

    But I also want to add this statement on a separate line:

    Please provide the CSR to proceed with the renewal.

    Thanks
    Naja

    How do I add that statement on a separate line.

  7. #7
    Naja is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2020
    Posts
    16
    I apologized for duplicating the message. I tried to remove it, but don't know how.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    You can concatenate vbCrLf outside the quotes and then the text you want on the next line.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Naja is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2020
    Posts
    16
    Quote Originally Posted by pbaldy View Post
    You can concatenate vbCrLf outside the quotes and then the text you want on the next line.
    I'll try and let you know how did it go.

    Thanks

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    No problem. I wasn't on a computer then, it would look like:

    "some text here" & vbCrLf & "this text will be on the next line"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    Naja is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2020
    Posts
    16
    Pbaldy,

    This is what I did and is giving me an error. Let me know what I'm doing wrong. Thanks

    Private Sub Command33_Click()
    DoCmd.SendObject acSendNoObject, , , Me.Combo36.Value, , , "Your Certificate Is Coming Up For Renewal " & [EndDate], "Please let me know if you are renewing your certificate " & [CommonName], vbCrLf & "Please provide the CSR to proceed with the renewal.", True
    End Sub

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    The comma is telling Access you're moving on to the next argument, EditMessage. Try replacing it with &:

    DoCmd.SendObject acSendNoObject, , , Me.Combo36.Value, , , "Your Certificate Is Coming Up For Renewal " & [EndDate], "Please let me know if you are renewing your certificate " & [CommonName] & vbCrLf & "Please provide the CSR to proceed with the renewal.", True

    When your arguments start getting complicated, I'd use a variable:

    Code:
    Dim strBody As String
    
    strBody = "Please let me know if you are renewing your certificate " &  [CommonName] & vbCrLf & "Please provide the CSR to proceed with the  renewal."
    
    DoCmd.SendObject acSendNoObject, , , Me.Combo36.Value, , , "Your Certificate Is Coming Up For Renewal " & [EndDate], strBody, True
    That makes for better readability (for me anyway) and easier debugging.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    Naja is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2020
    Posts
    16
    Quote Originally Posted by pbaldy View Post
    The comma is telling Access you're moving on to the next argument, EditMessage. Try replacing it with &:

    DoCmd.SendObject acSendNoObject, , , Me.Combo36.Value, , , "Your Certificate Is Coming Up For Renewal " & [EndDate], "Please let me know if you are renewing your certificate " & [CommonName] & vbCrLf & "Please provide the CSR to proceed with the renewal.", True

    When your arguments start getting complicated, I'd use a variable:

    Code:
    Dim strBody As String
    
    strBody = "Please let me know if you are renewing your certificate " &  [CommonName] & vbCrLf & "Please provide the CSR to proceed with the  renewal."
    
    DoCmd.SendObject acSendNoObject, , , Me.Combo36.Value, , , "Your Certificate Is Coming Up For Renewal " & [EndDate], strBody, True
    That makes for better readability (for me anyway) and easier debugging.
    Thank you, I will put it to the text and let you know. Thank you for taking the time to help me out. Much appreciated.

  14. #14
    Naja is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2020
    Posts
    16
    Quote Originally Posted by Naja View Post
    Thank you, I will put it to the text and let you know. Thank you for taking the time to help me out. Much appreciated.
    Just tested and it worked. Thanks

  15. #15
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Happy to help!
    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: 1
    Last Post: 09-27-2019, 10:58 AM
  2. Event procedure
    By vugar in forum Access
    Replies: 3
    Last Post: 09-09-2014, 11:36 PM
  3. Replies: 1
    Last Post: 03-29-2014, 07:46 PM
  4. Replies: 3
    Last Post: 05-07-2012, 12:17 PM
  5. On Click Event Procedure
    By MrDean in forum Forms
    Replies: 3
    Last Post: 10-07-2009, 07:16 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