Results 1 to 6 of 6
  1. #1
    richard1941 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    10

    Access says it can't find the code for my event procedures in a new database

    I have a form with a combo box and a button . In the property sheet of each there is an event procedure, After Update for the combo box and On Click for the button. In both cases I get the error message that is:

    The expression After Update 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.

    When I click on Show Help, I get the following explanation:
    This error occurs when an event has failed to run because the location of the logic for the event cannot be evaluated. For example, if the OnOpen property of a form is set to =[Field], this error occurs because a macro or event name is expected to run when the event occurs.

    As an example, the combo box is Combo27. The code it is supposed to go to is:

    Private Sub Combo27_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object
    Set rs = Me.Recordset.Clone


    rs.FindFirst "[LNFN] = '" & Me![Combo27] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub

    As the error suggests, when I put a breakpoint on the first line, it never gets there.

    This is a new project I just started yesterday. The code above is copied from an older project that works.

    Thanks for your help.
    Richard

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Use RecordsetClone, not Recordset.Clone

    I use:

    With Me.RecordsetClone
    .FindFirst "[LNFN] = '" & Me.Combo27 & "'"
    If Not .NoMatch Then Me.Bookmark = .Bookmark
    End With
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    richard1941 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    10
    No change. It never gets that far.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    The code syntax is good.

    Possibly corruption. Delete the button and create new one.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    richard1941 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    10
    Did that. Twice. With both controls.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    No idea. I would have to review database.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 06-23-2014, 12:18 PM
  2. Replies: 3
    Last Post: 02-11-2012, 11:17 AM
  3. Event Procedures
    By jlgray0127 in forum Forms
    Replies: 6
    Last Post: 11-04-2011, 02:24 PM
  4. Event procedures
    By GIS_Guy in forum Forms
    Replies: 1
    Last Post: 05-11-2010, 02:34 PM
  5. Replies: 0
    Last Post: 01-08-2009, 05:49 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
  •  
Other Forums: Microsoft Office Forums