Advertisement

05.13.2008 at 12:52PM PDT, ID: 23399198
[x]
Attachment Details

Automatic Email Distribution - MS Access

Asked by alliedtech in Access Architecture/Design, Outlook Groupware Software, Access Coding/Macros

Tags: Microsoft, Access, 2007

I have an MS Access program that monitors bids/quotes.  Each bid has a bid manager and a due date associated with that bid.  I run a query to determine if any bid are due within the next day.  I currently have the attached code behind a command button for testing purposes and it successfully emails the bid to the manager's stored email address.  However, my goal is to have the emails sent every morning at a set time, but only if the query returns any upcoming due bids.  Through reading various post and articles, I believe the following is the best method to accomplish my goals, but I am not quite sure how do execute the plan...

1. Install a copy of the front-end(including email modules/macros) on central server
2. Open the Access application via Windows Task Scheduler on the server
3. Execute a macro upon the opening of the Access app. that sends the emails
     - Run query to determine if any bids are due soon
     - Send SEPERATE emails for each bid to the associated bid manager
4. Close the app after a set amount of time

**Repeat Process Every Day

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
Private Sub Command47_Click()
     Dim BidsRs As DAO.Recordset, MgrRs As DAO.Recordset
    Dim olApp As Object, olMsg As Object
 
    Set olApp = CreateObject("Outlook.Application")
 
    Set BidsRs = CurrentDb.OpenRecordset("qryBidDueSoon")
    Do Until BidsRs.EOF
        Set MgrRs = CurrentDb.OpenRecordset("SELECT * FROM tblEmployee " & _
            "WHERE EmployeeID = " & BidsRs!EmployeeID)
        Set olMsg = olApp.CreateItem(0)
        With olMsg
            .Subject = "Bid Manager Alert: Bid# " & Format(BidsRs!BidNumber, "0000")
            .To = MgrRs!EmployeeEmail
            .Body = MgrRs!EmployeeName & "," & vbCrLf & vbCrLf & _
                "This is a reminder that Bid# " & Format(BidsRs!BidNumber, "0000") & " must be submitted to " & _
                BidsRs!ClientName & " by the close of business on " & BidsRs!BidDueDate & "."
            .Send
            MgrRs.Close
        End With
        BidsRs.MoveNext
    Loop
 
    BidsRs.Close
 
    Set BidsRs = Nothing
    Set MgrRs = Nothing
    Set olMsg = Nothing
    Set olApp = Nothing
 
    MsgBox "Done"
End Sub
[+][-]05.13.2008 at 04:03PM PDT, ID: 21560030

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Architecture/Design, Outlook Groupware Software, Access Coding/Macros
Tags: Microsoft, Access, 2007
Sign Up Now!
Solution Provided By: omgang
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.13.2008 at 04:06PM PDT, ID: 21560038

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 09:35AM PDT, ID: 21565998

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 09:44AM PDT, ID: 21566113

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 11:44AM PDT, ID: 21567321

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 12:06PM PDT, ID: 21567591

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 12:18PM PDT, ID: 21567727

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 12:53PM PDT, ID: 21568055

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 01:02PM PDT, ID: 21568125

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 01:24PM PDT, ID: 21568318

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 01:47PM PDT, ID: 21568531

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628