Results 1 to 6 of 6
  1. #1
    d3ell is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Location
    doncaster UK
    Posts
    20

    Upgraded to Access 2016 now some items not working

    Hi All,

    I spent a lot of time some years ago creating a database. I'm sure to most of you guys this is a very basic database, but as a nerwcomer to access it took me some time and with assistance from some lovely chaps on here and some other help i managed to create a working databes including some VB script.

    We recently upgraded to MS 2016 and now two buttons that were on the forms don't work. the first of which, when pressed converted the form to a .pdf and opened up outlook with certain fields filled in ready to click send. This button now does nothing when pressed. - I was wondering if someone could check the code to see if there needs to be a small ampendment for it to work with office 2016?

    VBA below

    Private Sub Command164_Click()
    Dim FileName As String
    Dim FilePath As String
    Dim oOutlook AsOutlook.Application
    Dim oEmailItem As MailItem

    FileName = "Plot "& Me.Customer_Plot_No & " " & Me.Development & "Work Sheet"
    FilePath = "C:\Users\angie\Dropbox(Bell)\Bell Team Folder\BELL ELECTRICAL\CUSTOMER CARE\Remedial Reports\WorkSheets" & FileName & ".pdf"
    'create temporary file
    DoCmd.OutputTo acOutputReport,"Employee Worksheet", acFormatPDF, FilePath
    If oOutlook Is Nothing Then
    Set oOutlook= New Outlook.Application


    End If
    Set oEmailItem =oOutlook.CreateItem(olMailItem)
    With oEmailItem
    .To =Me.Combo148
    .CC =""
    .Subject ="Plot " & Me.Customer_Plot_No & " " &Me.Development & " Work Sheet"
    .Attachments.Add FilePath
    .Display
    End With

    Set oEmailItem = Nothing
    Set oOutlook = Nothing
    'delete temporary file
    Kill FilePath

    End Sub


    The second button, when pressed simply saved the form as a pdf to a location on the end user PC. i have checked the location path and that is correct, however when this button is clicked nothing again happens - could you please check this?? - VBA below

    Private Sub Command166_Click()
    Dim FileName As String
    Dim FilePath As String

    FileName = "Plot "& Me.Customer_Plot_No & " " & Me.Development & "Work Sheet"
    FilePath ="C:\Users\angie\Dropbox (Bell)\Bell Team Folder\BELL ELECTRICAL\CUSTOMERCARE\Remedial Reports\work sheets" & FileName & ".pdf"
    DoCmd.OutputTo acOutputReport,"Employee Worksheet", acFormatPDF, FilePath
    MsgBox "Report SavedSuccessfully", vbInformation, "save confirmed"
    End Sub

    Your help would be much appreciated!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    1. if you upgraded, other items may have too. Check in the VBE menu: tools, references.
    See if anything is listed as MISSING. If so, uncheck it , and find the newer version.


    2. as an alternative ,you can send emails with a single DOCMD.SENDTO statement , instead of all that code above.

  3. #3
    d3ell is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Location
    doncaster UK
    Posts
    20
    Hi,

    Nothing is listed as "missing" - There are lots of boxes that are unchecked, only the 1st 5 boxes are checked

    with regard to your alternative, would it do the same thing where it puts in the destination email address, subject and body of the message so that the email is ready to send? - If not, then i'm not sure that would work.

    Are you familar with VB script? - does anything look a miss in there?

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Is your 2016 version in a "Trusted Location"? Google that if it's unfamiliar.

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    If it worked before, then upgrade stopped it, then something changed. (not in code tho)
    I use the same code you do to email. But I sometimes use the SendObject below:


    docmd.SendObject acSendReport ,"rMyReport",acFormatPDF, sTo,,,sSubj,sBody

    yes, check if outlook is trusted and macros are on.

  6. #6
    d3ell is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Location
    doncaster UK
    Posts
    20
    thanks for your help.

    It appears Macro's had not been enabled when updated.

    Much appreciated.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 09-06-2017, 12:14 PM
  2. Replies: 8
    Last Post: 07-13-2017, 08:46 PM
  3. Replies: 1
    Last Post: 02-23-2016, 11:14 AM
  4. Replies: 4
    Last Post: 12-21-2012, 10:24 AM
  5. Design Menu Items not working
    By 400Lifer in forum Misc
    Replies: 1
    Last Post: 05-05-2012, 10:18 AM

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