Help. I've done this before where a command button calls up module which sends a message to EmailAddress in tblEmail. But this time on form there are 3checkboxes, if box a is checked then the message is "checkbox a was checked", etc for b and c, then the module should run. Except when the module runs I get the error message "wrong # of Arguements, or invalid property assignment, on the SendObject line of code.
This is the code is the module:
ub OpenBla()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("tblEmail") 'table where email is
strEmail = rsEmail.Fields("EmailAddress").Value
rsEmail.MoveNext
Do While Not rsEmail.EOF
strEmail = strEmail & " ; " & rsEmail.Fields("EmailAddress").Value
rsEmail.MoveNext
Loop
'If Forms!frmEditEmail.Interim.Value = -1 Then
DoCmd.SendObject , , , strEmail, , , "test", , , False, ""MsgBox "E-Mail interim message has been sent"
End If
Any idea's
This is the code is the module:
ub OpenBla()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("tblEmail") 'table where email is
strEmail = rsEmail.Fields("EmailAddress").Value
rsEmail.MoveNext
Do While Not rsEmail.EOF
strEmail = strEmail & " ; " & rsEmail.Fields("EmailAddress").Value
rsEmail.MoveNext
Loop
'If Forms!frmEditEmail.Interim.Value = -1 Then
DoCmd.SendObject , , , strEmail, , , "test", , , False, ""MsgBox "E-Mail interim message has been sent"
End If
Any idea's