Results 1 to 4 of 4

Thread: emailing

  1. #1
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224

    Unanswered: emailing

    On my switchboard I have a button that emails my report , how do i set it so that it emails to certain email addresses

    thank you

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    That depends on how you are sending the report. If you are using vba with outlook, you can add new recipients. If you are using sendobject method, then use a recordset to loop through the email addresses and append to a string separated with semi colons ";".

    From access 2k3 online help:

    To Optional Variant. A string expression that lists the recipients whose names you want to put on the To line in the mail message. Separate the recipient names you specify in this argument and in the cc and bcc arguments with a semicolon ";" or with the list separator set on the Number tab of the Regional Settings Properties dialog box in Windows Control Panel. If the recipient names aren't recognized by the mail application, the message isn't sent and an error occurs. If you leave this argument blank, Microsoft Access prompts you for the recipients.

    If you need to send a single page of a multi page report to each person, pay stubs for example, then use the recordset and run the send object command for each iteration of the loop. The report's recordsource would have to know which employee code to print in my pay stubs example.
    Last edited by jmrSudbury; 04-20-04 at 16:34.

  3. #3
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224
    i am using the sendobject method
    not sure how to implement wat u mean

  4. #4
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    I would do the recordset something like this:

    dim rsr as recordset
    dim lstStr as string
    set rsr = currentdb().openrecordset("SELECT EmailColumnName FROM YourTableName;")

    while not rsr.eof
    lstStr = lstStr & kramer & ";"
    rsr.movenext
    wend
    rsr.close

    'lstStr will now contain the To: argument for your send objects command

Posting Permissions

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