+ Reply to Thread
Results 1 to 4 of 4

Trying to get hyphen into email

  1. #1
    Registered User
    Join Date
    06-24-2013
    Location
    SC
    MS-Off Ver
    Excel 2010
    Posts
    26

    Trying to get hyphen into email

    Hi, I have access db generating an email to be sent out using vba. However, for some reason the hyphen is not being placed in between the email addresses. Suggestions? thanks in advance

    Private Sub cmdfrmEmailReport_Click()
    On Error GoTo Err_Ctrl

    Dim sfile As String, sSubject As String, sBody As String, sMailTo As String, sMailCC As String

    10 If Not IsNull([Form_20 InspectEntry].BUYER) Then
    15 MsgBox "There is NO Buyer assigned to this Inspection, Please assign a Buyer to continue", vbOKOnly + vbExclamation, "No Buyer Assigned"
    20 Exit Sub
    25 End If

    30 sMailTo = [Form_20 InspectEntry].BUYER

    35 If Not IsNull([Form_20 InspectEntry].CC1) Then sMailCC = [Form_20 InspectEntry].CC1
    50 If Not IsNull([Form_20 InspectEntry].CC2) Then sMailCC = "; " & sMailCC & [Form_20 InspectEntry].CC2

    65 sSubject = "New Inspection Report"

    70 sBody = "You have a New Inspection Order to Disposition." & vbCr
    75 sBody = sBody & sBody = "Please Review Inspection: " & [Form_20 InspectEntry].ReportNo & vbCr
    80 sBody = sBody & sBody = "Created By: " & [Form_20 InspectEntry].User & vbCr
    85 sBody = sBody & sBody = Now() & vbCr & "Sent By: " & Form_SwitchBoard.UserNameField

    90 sfile = ""

    95 Call Mail_Outlook(sfile, sMailTo, sMailCC, sSubject, sBody, bSendEmail)

    100 Me.cmdfrmClose.SetFocus
    105 Me.cmdfrmEmailReport.Visible = False

    Exit_Sub:
    5000 Exit Sub

    Err_Ctrl: ' Call Local Form Level Error Routine
    5005 el = erl
    5010 en = Err.number
    5015 ed = Err.Description
    5020 errMsgStr = "Form '20 InspectEntry"
    5025 ctrlfnctnm = "cmdfrmEmailReport_Click()"
    5030 Call form_err(en, ed, ctrlfnctnm, el, errMsgStr)
    5035 Resume Exit_Sub
    End Sub

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Trying to get hyphen into email

    Do you mean semi colon ;?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    06-24-2013
    Location
    SC
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Trying to get hyphen into email

    Yes, I apologize. It would help if I used the correct wording.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,811

    Re: Trying to get hyphen into email

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 08-11-2016, 11:25 AM
  2. dont understand hyphen hyphen
    By pg300 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-30-2014, 12:42 AM
  3. how to type hyphen?
    By anantamjn in forum Excel General
    Replies: 6
    Last Post: 04-26-2013, 05:49 AM
  4. Getting rid of hyphen
    By Rogermb in forum Excel General
    Replies: 2
    Last Post: 02-01-2008, 11:35 AM
  5. ...I want to display a hyphen instead of zero...
    By Dr. Darrell in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  6. ...I want to display a hyphen instead of zero...
    By Dr. Darrell in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. ...I want to display a hyphen instead of zero...
    By Dr. Darrell in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1