Results 1 to 5 of 5

"A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control"

  1. #1
    dylanjstow is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    3

    Question "A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control"

    I am experiencing this error:
    "The expression On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control."

    My database is not online (connected to a LAN shared drive but not the web), so I don't know what it means by communicating with the OLE server, and the suggestions for the problem say that my expression may not be the name of a macro, etc., or [Event Procedure], but when I look it says [Event Procedure] in the property sheet for that button, and all of the other events are blank. It suggests there may be an error evaluating the function/event/macro, but I don't know how to diagnose this because I am new to visual basic and relatively new to Access.



    It's a button that, when clicked, runs some code that I based on someone else's code for changing some SQL and opening a form with a newly written query embedded.

    If anyone has any ideas for what is causing this, or just general steps to troubleshoot, that would be appreciated. Below is the code, there is only one input field from a form (AppType), but I plan to expand this to include other filters once I have this working for one.

    Code:
    Private Sub apply_click()
    Dim strSQL As String
    Dim strApp As Variant
    'unsure if needs to be string, variant, etc., or if that matters
    Dim qdf As DAO.QueryDef
    Let strApp = [AppType]
    'unsure if this ^ is correct syntax
    If strApp <> "" Then
        strSQL = "SELECT * FROM qryAllData WHERE tblUsage.usage = " & strApp & ";"    'tblUsage contains relationships between input [AppType] and part numbers (primary key for qryAllData)
        Else: strSQL = "SELECT * FROM qryAllData;"
    End If
    Set qdf = CurrentDb.QueryDefs("qryAdvisor")
    qdf.SQL = strSQL
    qdf.Close
    DoCmd.OpenForm ("Advice") 'Contains qryAdvisor in the form
    Set qdf = Nothing
    End Sub
    Note: I will not be able to reply to anything outside of M-W-F, 3PM-7PM CDT because this is a work project (odd hours because part-time intern)
    Last edited by dylanjstow; 10-24-2018 at 05:42 PM. Reason: incorrect code

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    2,113
    This is corruption.
    Try this:
    In the vb editor for the form's code, Ctrl-A. This will select all the code.
    Do Ctrl-X. This will cut all the code.
    Compact/repair the DB.
    Go back to the form's code module and paste the code back in. Ctrl-V.
    Compile the code and save.
    See if it worked.

  3. #3
    dylanjstow is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    3
    Thanks for the help, but unfortunately that didn't fix the problem . Nothing changed about the error message either.

  4. #4
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    360
    Not corruption. An error that could be caused by a variety of reason, see *the Google* (a couple of search results below)...
    https://social.technet.microsoft.com...ffice2016ITPro
    https://answers.microsoft.com/en-us/...6-a19a3655e4a4
    Gina Whipp
    Microsoft MVP (Access 2010-2015)
    https://www.access-diva.com/tips.html

  5. #5
    dylanjstow is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    3
    Thanks for the responses!

    Solved the problem by creating a new blank database and importing all of my objects into it. The other solutions might have worked on an online database, but didn't apply to mine (couldn't find the file mentioned, etc). I still think it's strange that an issue that seems to be almost exclusively on online databases, and seems to be related to the fact that they are online, appeared on my local database. Maybe this will help someone who is having the same problem on a local database who, like me, couldn't find anything about it.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-11-2018, 12:57 PM
  2. Replies: 1
    Last Post: 10-04-2016, 04:29 PM
  3. Replies: 1
    Last Post: 05-22-2013, 02:34 PM
  4. Replies: 2
    Last Post: 04-23-2013, 12:44 AM
  5. A problem occurred while Microsoft Access...
    By nchesebro in forum Programming
    Replies: 16
    Last Post: 03-04-2011, 04:19 PM

Tags for this Thread

Posting Permissions

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