Hey everyone,
I have 2 questions about emailing if someone can help me.
1. I have a continuous form with a dropdown box in the header. If the user clicks on, for example "foreman", it brings up all the information of all the foreman, name, address, phone number and email address. The code below creates an email and takes all the email address for each foreman to send a mass email. The problem I'm having is that it only takes the first 9 email addresses, if there are 10 or more foreman then it will not create an email! How can i get it so that it works for more than 9 fields
2. I'm not sure if the following is possible but I'll see if anyone has any idea's. Going from my first question, if the user choose's "foreman" again from the dropdown box and it brings up the name, address, phone no and email address for each foreman. Is it possible that when the user clicks a button an individual email is sent to each foreman with the body of the email with each foremans unique details. So "John Smith" will get an email with only his details," Paul Smith" will get an email with only his details etc.
Thanks,
nim
I have 2 questions about emailing if someone can help me.
1. I have a continuous form with a dropdown box in the header. If the user clicks on, for example "foreman", it brings up all the information of all the foreman, name, address, phone number and email address. The code below creates an email and takes all the email address for each foreman to send a mass email. The problem I'm having is that it only takes the first 9 email addresses, if there are 10 or more foreman then it will not create an email! How can i get it so that it works for more than 9 fields
Code:
Private Sub Command6_Click()
On Error Resume Next
Dim strToWhom As String
Dim strMsgBody As String
Dim strTitle As String
With Me.Recordset
.MoveFirst
While Not .EOF
strToWhom = strToWhom & ";" & Me!Email
.MoveNext
Wend
strToWhom = Mid(strToWhom, 2)
End With
strMsgBody = "Sample"
strTitle = "Test"
DoCmd.SendObject , , , strToWhom, , , strTitle, strMsgBody, True
End Sub
2. I'm not sure if the following is possible but I'll see if anyone has any idea's. Going from my first question, if the user choose's "foreman" again from the dropdown box and it brings up the name, address, phone no and email address for each foreman. Is it possible that when the user clicks a button an individual email is sent to each foreman with the body of the email with each foremans unique details. So "John Smith" will get an email with only his details," Paul Smith" will get an email with only his details etc.
Thanks,
nim