event property setting produces error (1 Viewer)

exaccess

Registered User.
Local time
Today, 11:11
Joined
Apr 21, 2013
Messages
287
Code:
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

Now this is the error message that I am constantly getting from any command button I hit on a certain form. Here is the code of the form.
Code:
Option Compare Database
Option Explicit
Public inputCSV As String, ORG As String

Private Sub CopyToTableBt_Click()
    Debug.Print "Sub Execute calling ImportCSVForConfederation inputCSV="; inputCSV; " ORG="; ORG
    ImportCSVForConfederation Me.CSVs, ORG
End Sub

Private Sub ExploreWindowBt_Click()
    inputCSV = GetCSVFile
    Me.CSVs = inputCSV
End Sub

Private Sub CheckInterBt_Click()
    DoCmd.OpenTable "TransTbl", acViewNormal, acEdit
End Sub

Private Sub OrListBx_Click()
    Dim organ As String
    organ = Me.OrListBx.Value
    Select Case organ
        Case "SHAPEX"
            ORG = "SH"
        Case "NAREX"
            ORG = "NA"
        Case "AGERX"
            ORG = "AG"
        Case "OTHERS"
            ORG = "OT"
    End Select
    Debug.Print "Sub OrList ORG="; ORG
End Sub

Private Sub ClosingBt_Click()
On Error GoTo Err_ClosingBt_Click

    If Me.Dirty Then Me.Dirty = False
    DoCmd.Close

Exit_ClosingBt_Click:
    Exit Sub

Err_ClosingBt_Click:
    MsgBox Err.Description
    Resume Exit_ClosingBt_Click
    
End Sub


Private Sub UpdateARODBBt_Click(ORG)
    UpdateWithConfederation
End Sub

I changed the names of the buttons, reconstructed the code under those names, went to the modules and changed names, made sure that a sub o function name is not duplicated in the project... But helas the error is still there. It used to work and suddenly does not work. Help Please.
 

JHB

Have been here a while
Local time
Today, 11:11
Joined
Jun 17, 2012
Messages
7,732
In which line do you get the error?
What is that, (do you have a button called UpdateARODBBt, if yes remove the ORG)?
Code:
Private Sub UpdateARODBBt_Click([COLOR=Red][B]ORG[/B][/COLOR])  
   UpdateWithConfederation 
End Sub
You didn't show the function "ImportCSVForConfederation"
 

exaccess

Registered User.
Local time
Today, 11:11
Joined
Apr 21, 2013
Messages
287
In which line do you get the error?
What is that, (do you have a button called UpdateARODBBt, if yes remove the ORG)?
Code:
Private Sub UpdateARODBBt_Click([COLOR=Red][B]ORG[/B][/COLOR])  
   UpdateWithConfederation 
End Sub
You didn't show the function "ImportCSVForConfederation"

Yes that was the culprit. Curiously I never got a message on that line. The program was just refusing to start no matter which button was pressed always the same message. Anyway many thanks. Now it works. Sometimes one looks at the same place hundred times and does not see the obvious.
 

Users who are viewing this thread

Top Bottom