Error: Expression On Click you entered as the event property..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mcupito
    Contributor
    • Aug 2013
    • 294

    Error: Expression On Click you entered as the event property..

    "The expression On Click you entered as the event property setting produced the following error: Procedure declaration does not match description of event or procedure having the same name."

    That's the error I am receiving when I am trying to click a button, on a bound form to a table, that executes this code:

    Code:
    Private Sub HomeBtn_Click()
    
    Call ElectionAwardUpdate
    
    DoCmd.Close acForm, Me.Name
    DoCmd.OpenForm "Home"
    
    End Sub
    The "Call ElectionAwardUp date" is a Module, and here is the code:

    Code:
    Public Sub ElectionAwardUpdate()
    
        'update non-identifying foreign key to reflect new elections
        DoCmd.SetWarnings False
            DoCmd.OpenQuery "UpdateAwardPriElectionQry"
            DoCmd.OpenQuery "UpdateAwardSecElectionQry"
        DoCmd.SetWarnings True
    
    End Sub
    Does anyone know how to get rid of this error: I did some Googling and tried to Import all objects into a new database, Compact & Repair, comment out certain lines of code. Nothing worked.

    Any ideas? Thank you.
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1291

    #2
    mcupito,
    Go double-check the property setting for the click event on the button or object that got clicked. I've fat-fingered that before and accidentally changed [Event Procedure] to some other choice on the drop-down list for the event.

    Jim

    Comment

    • mcupito
      Contributor
      • Aug 2013
      • 294

      #3
      I got fed up with it, so I just created a new form. Not quite sure where the error was coming from, to be honest.

      I pasted the same VBA behind the form without any errors and everything works. It must have been corrupted somehow.

      Anyway, thanks for the reply, Jim.

      Comment

      Working...