A
AJ
I appreciate the help I have received so far, but I can get nothing to work
correctly.
I have a form for entering an action plan, this form has a subform where all
the action items for that plan are listed. Each action item is assigned to a
person, this field is a combo box which pulls from a table where email
addresses are listed. I want an option button (or as an update from a text
field) so that emails will be sent to each address in the subform. The
option button would be on the main form. I did create a textbox on the form
called email to "convert" the combobox to text.
Here is the code I have on the button right now:
Private Sub OptionButton2_Enter()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
Dim tostr As String
With Me![Actions Table subform].Form.RecordsetClone
If .RecordCount > 0 Then
.MoveFirst
Do Until .EOF
tostr = tostr & Me.Actions_Table_subform.Form!email & ";"
.MoveNext
Loop
End If
End With
DoCmd.SendObject acSendNoObject, , , tostr, , , "action plan", , , False
End Sub
Right now it seems to be repeating the same email on the first record in
subform for all of them (ie, if there are 3 action items in the subform and
all 3 ahve different person assigned the email has the email address from the
first one repeated 3 times),
If I can ever get this working... is there a way to not repeat the email
addresses, ie, if there are 3 items and 2 are assigned to the same person the
email only lists them once.
Thanks so much for any help. I will be very grateful!
correctly.
I have a form for entering an action plan, this form has a subform where all
the action items for that plan are listed. Each action item is assigned to a
person, this field is a combo box which pulls from a table where email
addresses are listed. I want an option button (or as an update from a text
field) so that emails will be sent to each address in the subform. The
option button would be on the main form. I did create a textbox on the form
called email to "convert" the combobox to text.
Here is the code I have on the button right now:
Private Sub OptionButton2_Enter()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
Dim tostr As String
With Me![Actions Table subform].Form.RecordsetClone
If .RecordCount > 0 Then
.MoveFirst
Do Until .EOF
tostr = tostr & Me.Actions_Table_subform.Form!email & ";"
.MoveNext
Loop
End If
End With
DoCmd.SendObject acSendNoObject, , , tostr, , , "action plan", , , False
End Sub
Right now it seems to be repeating the same email on the first record in
subform for all of them (ie, if there are 3 action items in the subform and
all 3 ahve different person assigned the email has the email address from the
first one repeated 3 times),
If I can ever get this working... is there a way to not repeat the email
addresses, ie, if there are 3 items and 2 are assigned to the same person the
email only lists them once.
Thanks so much for any help. I will be very grateful!