L
Linda in Iowa
using access 2003
I have a form based on a query that only shows records based on a date
entered by the user.
When a button on the form is clicked the email program opens with the
subject, message, and email already input. the user just needs to click
send without any addition input to the message.
Here is the code on the button:
Me.EMAIL = Replace(Me.EMAIL, "http://", "mailto:")
DoCmd.SendObject acSendNoObject, , , Me!EMAIL, , , "subject", "message
is entered here"
This works fine, but I would like to cycle through the records and add all
email addresses to one email so it can be sent one time to all instead of
sending to each email.
This code is supposed add the email addresses to the CC of the email, but I
get compile error: user-defined type not defined and
'rst As ADODB.Recordset' on the first line of code is highlighted.
Dim rst As ADODB.Recordset
Dim strCC As String
Set rst = New ADODB.Recordset
rst.Open "qrymemexpnotice", CurrentProject.Connection, adOpenStatic,
adLockOptimistic
With rst
If .RecordCount > 0 Then
Do Until .EOF
If Not IsNull(.Fields("email")) Then
strCC = strCC & .Fields("email") & ";"
End If
.MoveNext
Loop
End If
.Close
End With
Set rst = Nothing
Me.EMAIL = Replace(Me.EMAIL, "http://", "mailto:")
DoCmd.SendObject acSendNoObject, , , Me!EMAIL, strCC, , "subject",
"Message"
how do I fix the user-defined type not defined?
thank you
I have a form based on a query that only shows records based on a date
entered by the user.
When a button on the form is clicked the email program opens with the
subject, message, and email already input. the user just needs to click
send without any addition input to the message.
Here is the code on the button:
Me.EMAIL = Replace(Me.EMAIL, "http://", "mailto:")
DoCmd.SendObject acSendNoObject, , , Me!EMAIL, , , "subject", "message
is entered here"
This works fine, but I would like to cycle through the records and add all
email addresses to one email so it can be sent one time to all instead of
sending to each email.
This code is supposed add the email addresses to the CC of the email, but I
get compile error: user-defined type not defined and
'rst As ADODB.Recordset' on the first line of code is highlighted.
Dim rst As ADODB.Recordset
Dim strCC As String
Set rst = New ADODB.Recordset
rst.Open "qrymemexpnotice", CurrentProject.Connection, adOpenStatic,
adLockOptimistic
With rst
If .RecordCount > 0 Then
Do Until .EOF
If Not IsNull(.Fields("email")) Then
strCC = strCC & .Fields("email") & ";"
End If
.MoveNext
Loop
End If
.Close
End With
Set rst = Nothing
Me.EMAIL = Replace(Me.EMAIL, "http://", "mailto:")
DoCmd.SendObject acSendNoObject, , , Me!EMAIL, strCC, , "subject",
"Message"
how do I fix the user-defined type not defined?
thank you