Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Microsoft Access Email Seminar    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Microsoft Access Email Seminar
Thomas F 
    
9 years ago
Thank you for your seminar and responding to the earlier post. I now have the group email I wanted.
My question now is when I try to query my list of people to receive the email I get an error message [Run-time-error Too Few parameters Expected 1]
If this is something I can get from one of your lessons I will be glad to look (I am the proud owner of numerous lessons)
I have included my code with a note as to where it stops. Any help are guidance would be appreciated
Thank again

Private Sub Command0_Click()
Dim oOutlook As Outlook.Application
Dim oEmailItem As MailItem
Dim rs As Recordset

If oOutlook Is Nothing Then
    Set oOutlook = New Outlook.Application
End If

Set oEmailItem = oOutlook.CreateItem(olMailItem)
With oEmailItem
    
    'This first attempt works to list all in the emails for the ActionGroup named Manager
    'Set rs = CurrentDb.OpenRecordset("SELECT AddressEmail FROM ActionGroupQ where ActionGroup='Manager'")
                
    'The second attempt works to list all of the AddressEmail in the ActionGroupQ query
    'Set rs = CurrentDb.OpenRecordset("SELECT AddressEmail FROM ActionGroupQ")
        
    'Code will not pass this point.
    'What I want but will not work, I want all of the AddressEmail,s from ActionGroupQ
    'where the ActionGroup = the forms GroupsCombo combo box
    Set rs = CurrentDb.OpenRecordset("SELECT AddressEmail FROM ActionGroupQ where ActionGroup=GroupsCombo")
        
    If rs.RecordCount > 0 Then
        rs.MoveFirst
        Do Until rs.EOF
            If IsNull(rs!AddressEmail) Then
                rs.MoveNext
            Else
                contactEmail = contactEmail & rs!AddressEmail & ";"
                .To = contactEmail
                rs.MoveNext
            End If
        Loop
    Else
        MsgBox "No email addresses available"
    End If
    .Display
End With

Set oEmailItem = Nothing
Set oOutlook = Nothing

End Sub



Reply from Alex Hedley:

Rich showed a video recently where controls on a form would be parsed by access in a string but what version of Access are you using?

Set rs = CurrentDb.OpenRecordset("SELECT AddressEmail FROM ActionGroupQ where ActionGroup=GroupsCombo")

Set rs = CurrentDb.OpenRecordset("SELECT AddressEmail FROM ActionGroupQ where ActionGroup='" & GroupsCombo & "'")

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Microsoft Access Email Seminar.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/16/2026 7:53:14 PM. PLT: 0s