Entering email address puts a semicolon instead of a comma

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

Hoping you can help. I have a subform that has a command button that starts
an email message. It is supposed to take the name on the main form and put
it into the To field of an email message. It does this except that it puts a
semi-colon instead of the comma I need. Our email system uses this
convention to email people: "LastName, FirstName".

Here's what I've entered so far in the event procedure:


Private Sub cmdSendEmail_Click()
Dim strEmailAddress As String
Dim strSubject As String

strEmailAddress = Forms!frmContactDataEntry![LName] & ", " &
Forms!frmContactDataEntry![FName]
strSubject = Me![IssueName] & " - " & Me![IssueTransDate]

DoCmd.SendObject acSendNoObject, , , strEmailAddress, , , strSubject


The subject is in the subform but the name is messing with me. Help!

Thanks!
Chris
 
Have you tried

strEmailAddress = """" & Forms!frmContactDataEntry![LName] _
& ", " & Forms!frmContactDataEntry![FName] & """"

This will quote delimit the e-mail alias.
 
Have you tried

strEmailAddress = """" & Forms!frmContactDataEntry![LName] _
& ", " & Forms!frmContactDataEntry![FName] & """"

This will quote delimit the e-mail alias.
 
Works perfectly! Thanks Terry!

Terry Kreft said:
Have you tried

strEmailAddress = """" & Forms!frmContactDataEntry![LName] _
& ", " & Forms!frmContactDataEntry![FName] & """"

This will quote delimit the e-mail alias.


--

Terry Kreft


Chris Armistead said:
Hi all,

Hoping you can help. I have a subform that has a command button that starts
an email message. It is supposed to take the name on the main form and put
it into the To field of an email message. It does this except that it puts a
semi-colon instead of the comma I need. Our email system uses this
convention to email people: "LastName, FirstName".

Here's what I've entered so far in the event procedure:


Private Sub cmdSendEmail_Click()
Dim strEmailAddress As String
Dim strSubject As String

strEmailAddress = Forms!frmContactDataEntry![LName] & ", " &
Forms!frmContactDataEntry![FName]
strSubject = Me![IssueName] & " - " & Me![IssueTransDate]

DoCmd.SendObject acSendNoObject, , , strEmailAddress, , , strSubject


The subject is in the subform but the name is messing with me. Help!

Thanks!
Chris
 
Works perfectly! Thanks Terry!

Terry Kreft said:
Have you tried

strEmailAddress = """" & Forms!frmContactDataEntry![LName] _
& ", " & Forms!frmContactDataEntry![FName] & """"

This will quote delimit the e-mail alias.


--

Terry Kreft


Chris Armistead said:
Hi all,

Hoping you can help. I have a subform that has a command button that starts
an email message. It is supposed to take the name on the main form and put
it into the To field of an email message. It does this except that it puts a
semi-colon instead of the comma I need. Our email system uses this
convention to email people: "LastName, FirstName".

Here's what I've entered so far in the event procedure:


Private Sub cmdSendEmail_Click()
Dim strEmailAddress As String
Dim strSubject As String

strEmailAddress = Forms!frmContactDataEntry![LName] & ", " &
Forms!frmContactDataEntry![FName]
strSubject = Me![IssueName] & " - " & Me![IssueTransDate]

DoCmd.SendObject acSendNoObject, , , strEmailAddress, , , strSubject


The subject is in the subform but the name is messing with me. Help!

Thanks!
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top