Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Dec 2008
    Location
    Gloucester, Gloucestershire, United Kingdom
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sending emails to different groups in Access (Access 2000 +)

    Hi,

    I'm fairly inexperienced re: access and VB code, but always up for giving it a go and would appreciate any help you guys can give about the following...

    I have a database managing different clients info...our clients are categorised via different topics...

    It would be really useful to select those clients of a particular topic, and send them a group email...Ideally I guess this would mean putting all the particular records 'email' info into the bcc field into an new message in outlook...if there's ways to bypass outlook then that would be great...what would be perfect is if anyone knows how to do that using googlemail.



    but for now the simple task of putting all my 'email' records into one field, then to export/copy and paste that into a bcc field would be really useful.

    any ideas?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Sending emails to different groups in Access (Access 2000 +)

    Welcome to Woody's Lounge!

    You can concatenate e-mail addresses by topic into a long string using the Concat function from the attachment to <post#=301,393>post 301,393</post#>.
    You can use this string to specify the BCC address in a DoCmd.SendObject instruction. This will create/send an e-mail using your default e-mail application.

    If you would like more detailed help, please provide more information.

  3. #3
    New Lounger
    Join Date
    Dec 2008
    Location
    Gloucester, Gloucestershire, United Kingdom
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sending emails to different groups in Access (Access 2000 +)

    Hi Hans,

    Thanks for that. and thanks for the welcome!

    Sorry for my ignorance though (i'm fairly new to this) ... Do I need to paste that into a new module in VB? Also, do you have another example whereby i could see which parts I could edit for my db - e.g. where I add the table names / field names etc for the function to work properly...

    For others reading this thread...and to give more detail - an example would be:

    [Client Name] ¦ [Topic] ¦ Email

    exampleA) ¦ restaurant ¦ exampleA@suchandsuch
    exampleB ¦ motoring ¦ exampleB@carandgarage
    exampleC ¦ restaurant ¦exampleC@anotherrestaurant

    The idea is to get a drop down box to choose the topic, then click "go" to launch the code...e.g. using the above example, concatinating the restaurants topic would give this output:

    [Client name] ¦ [Email output - as a memo datatype?]
    restaurant ¦ exampleA@suchandsuch, exampleC@anotherrestaurant

    etc. etc.

    The final stage is to then put all of these email addresses into the BCC field of a new email message.

    It's a bit of a mammoth task for such a straight forward idea. but hoping to get it sorted.

    Thanks for any help you can give.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Sending emails to different groups in Access (Access 2000 +)

    I have attached a zipped sample database. You can import the basConcatenate module from that database into your own database (using File | Get External Data | Import...)

    Note: you must set a reference to the Microsoft DAO 3.6 Object Library in Tools | References... in the Visual Basic Editor for the code to work.

    I have added a small sample table tblClients, and a query qryMailAddresses that lists the e-mail addresses by topic.

    The module basMail contains a procedure that will create an e-mail for each topic.
    Attached Files Attached Files

  5. #5
    New Lounger
    Join Date
    Dec 2008
    Location
    Gloucester, Gloucestershire, United Kingdom
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sending emails to different groups in Access (Access 2000 +)

    That is amazing!

    Works brilliantly. Thanks so much...I may have to get your wisdom on how to implement and run the code for the eMail function - but I'll give it a go and see if I can figure it out.

    Thanks again. Really appreciate it.

  6. #6
    New Lounger
    Join Date
    Dec 2008
    Location
    Gloucester, Gloucestershire, United Kingdom
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sending emails to different groups in Access (Access 2000 +)

    Hi again,

    I get an error with the email module...i'm trying to choose the topic from a drop down box, then click a button to run the code according to the chosen topic...but I get the following error....I tried running the original module without any changes and got the same msg :

    "an expression you entered is the wrong data type for one of the arguments"

    ?


  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Sending emails to different groups in Access (Access 2000 +)

    Can you post a copy of what you are working with to look at? Just the bare minimum to see your error.
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •