Page 3 of 3 FirstFirst 123
Results 31 to 42 of 42
  1. #31
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    Hello alex
    yes i i'm using


    DoCmd.SendObject acQuery, "InsuranceTable Query", "Excel97-Excel2003Workbook(*.xls)", "naresh.joshy@gmail.com.np;", "", "", "Insurance Renewal List", "Dear Sir, Plz renewal the attached list Thanking you ", False, ""
    and it is working. i'm not using email ID form recordset.
    but event there are no any record in query although email have been sending. but i don't want to send email if there is no record in query.
    Thanking You

  2. #32
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    auto email to client before 30 days of expiry of loan

    Ah it seemed like you had a list of emails and you want to send a report to each person in this list.

    Is your case that you just want to send a query to 1 person?

    You could check if the query contains some data before you send the object.

  3. #33
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    firstly i was tried to send a report to each person i this list but now i want to send list ot 1 person only.
    but if there is no record in list email should not be sent.

  4. #34
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    auto email to client before 30 days of expiry of loan

    Check if the following is 0.

    Code:
    Dim lngCount as Long
    lngCount = DCount("*", "NameOfTable/Query")

  5. #35
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    Thank You it is working. i also want to update related record on remarks field as "Yes". what should i have to now?

  6. #36
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    auto email to client before 30 days of expiry of loan


  7. #37
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    Yes i can make update query. and i come to my first question. what should i have to do for sending mail to recordset emailid?

  8. #38
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    auto email to client before 30 days of expiry of loan

    Create a Query that lists the Email Addresses, then loop through that passing the email address into the address part of the send command.

  9. #39
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    can you provide me code for it.
    Create a Query that lists the Email Addresses, then loop through that passing the email address into the address part of the send command.

  10. #40
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Do you have a query saved? What is its name? What are the names of the fields?

  11. #41
    joshynaresh is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    131
    Yes I have Query. Query Name is EmailList and filed Name is EmailID.
    Thank You.

  12. #42
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    auto email to client before 30 days of expiry of loan

    You are going to need more info in your Query, required is the EmailAddress or how do you know who you are sending it to, helpful would be Name so you can say Hi <NAME>, ...

    If you look into RecordSets and Looping through them, there are probably many on the Forum.

    Then you just need to pass in the Email Address to the following code you already have:

    Amended
    Code:
    DoCmd.SendObject acQuery, "InsuranceTable Query", "Excel97-Excel2003Workbook(*.xls)", <EMAIL_ADDRESS>, "", "", "Insurance Renewal List", "Dear " & <NAME> & ", Plz renewal the attached list Thanking you ", False, ""

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 29
    Last Post: 12-17-2014, 08:46 PM
  2. Auto-Generated Email
    By jle0003 in forum Access
    Replies: 3
    Last Post: 08-20-2012, 01:33 PM
  3. Auto Run Report then Auto Email
    By jo15765 in forum Reports
    Replies: 1
    Last Post: 10-05-2011, 10:57 AM
  4. Replies: 1
    Last Post: 07-26-2011, 06:10 AM
  5. Auto email query
    By warrigal in forum Database Design
    Replies: 3
    Last Post: 03-23-2011, 07:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums