+ Reply to Thread
Results 1 to 4 of 4

Thread: Adding a date to an Access EMailDatabaseObject macro

  1. #1
    Registered User
    Join Date
    12-15-2011
    Location
    Charleston, SC
    MS-Off Ver
    Excel 2010
    Posts
    43

    Adding a date to an Access EMailDatabaseObject macro

    I would like to add the day of the week and date to the subject/body of an email being sent when a command button is clicked on a form in Access 2010. How is this accomplished?

    Here is a screenshot of the macro.
    EMailDatabaseObject.jpg

    I converted the macro to VBA, but until I become better familiar with VBA in Access, I would like to stick with macros. I did add the =NOW function to the code and it works, but it also includes the time which I do not want. Also I'm not sure how to add the day of the week.

    Any help with this is appreciated.

    Option Compare Database
    
    Function mcr_EmailReport2CS()
    On Error GoTo mcr_EmailReport2CS_Err
    
        DoCmd.SendObject acReport, "rpt_LTL Shipments for CS", "PDFFormat(*.pdf)", "email@domain.com", _
        "", "", "LTL Shipping Report ( " & Now() & " )", "Attached is the shipping report for " & Now(), True, ""
    
    mcr_EmailReport2CS_Exit:
        Exit Function
    
    mcr_EmailReport2CS_Err:
        MsgBox Error$
        Resume mcr_EmailReport2CS_Exit
    
    End Function

  2. #2
    Registered User
    Join Date
    12-15-2011
    Location
    Charleston, SC
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Adding a date to an Access EMailDatabaseObject macro

    Found answer that works in VBA which is...

    & WeekdayName(Weekday(Date)) & " " & Date &
    But would still like to know if this is possible in the Macro Builder in Access 2010.

  3. #3
    Registered User
    Join Date
    01-26-2012
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Adding a date to an Access EMailDatabaseObject macro

    Thank you very much for posting this article. Its a very useful article. We will be acquire lot of things from this site.So i want some information about this post.

    Water Damage Restoration Miami

  4. #4
    Registered User
    Join Date
    01-26-2012
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    2

    Cool Re: Adding a date to an Access EMailDatabaseObject macro

    Thank you very much for posting this article. Its a very useful article. We will be acquire lot of things from this site.So i want some information about this post.

    Water Damage Restoration Miami

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0