Hi. I'm running win 10 (updated to most recent).
I've recently rebuilt my computer and have reinstalled Access 2007 and a split database. In the front-end there is a script to email a message to multiple recipients. I select the recipients from a list and click a "send" button, intending to send it as an email in Thunderbird. I'm using the standard Sendobject code.
It used to work and now doesn't. The same database is used on another computer (both front-end and back-end are on a cloud drive) without problems. I get the message:
"Runtime error 2046:
The command or action SendObject isn't available now."
I have spent days looking for a solution.
Can anyone help?
Thanks in advance.
Full code of subroutine follows. Note that in the following there is a function called ConcatRelated. It works to create a string of email recipients. It definitely works:
I've recently rebuilt my computer and have reinstalled Access 2007 and a split database. In the front-end there is a script to email a message to multiple recipients. I select the recipients from a list and click a "send" button, intending to send it as an email in Thunderbird. I'm using the standard Sendobject code.
It used to work and now doesn't. The same database is used on another computer (both front-end and back-end are on a cloud drive) without problems. I get the message:
"Runtime error 2046:
The command or action SendObject isn't available now."
I have spent days looking for a solution.
Can anyone help?
Thanks in advance.
Full code of subroutine follows. Note that in the following there is a function called ConcatRelated. It works to create a string of email recipients. It definitely works:
Code:
Private Sub Command76_Click()
'Check for empty Subject line
If IsNull(Text89) Then
MsgBox "Please enter some text for the SUBJECT.", vbOKOnly, "Error"
Text89.SetFocus
Exit Sub
End If
'Check for empty text
If IsNull(Text73) Then
MsgBox "Please enter some text for the MESSAGE.", vbOKOnly, "Error"
Text73.SetFocus
Exit Sub
End If
'Determine the recipients to be sent an email
Dim varItem As Variant
Dim recipients As String
'Determine if at least one course has been selected
If List77.ItemsSelected.Count = 0 Then
MsgBox "Please select at least one course", vbOKOnly, "Error"
Exit Sub
End If
'Collect email addresses of the recipients
recipients = ""
Lc = List77.ListCount
'If "ALL" is selected, then select all courses
If List77.Selected(1) Then
Dim i As Integer
For i = 0 To List77.ListCount - 1
List77.Selected(i) = True
Next i
End If
'loop through all selected courses
Dim z As Long
With List77
For z = 2 To Lc
If List77.Selected(z) Then
If Check81 Then recipients = ConcatRelated("Invoicemail", "BulkEmail", "[coursekey]= """ & .ItemData(z) & """", , ";") & recipients 'Email invoicees
If Check79 Then recipients = ConcatRelated("StudentEmail", "BulkEmail", "[coursekey]= """ & .ItemData(z) & """", , ";") & recipients 'Email Students
End If
Next z
End With
'remove duplicates
recipients = EliminateDupesInString(recipients, ";")
' Calculate number of email addresses
If recipients <> "" Then x = Len(recipients) - Len(Replace(recipients, ";", ""))
MsgBox "There are " & Str(x) & " addresses."
If recipients <> "" Then DoCmd.SendObject acSendNoObject, , acFormatRTF, "office@xxx.com", , recipients, Text89, Text73, True
DoCmd.Close
End Sub
Comment