Receiving "Procedure declaration does not match description of event or procedure having same name" Error

Viewed 176

I wrote a database for a soil drilling company. When a user adds a new project, they enter the number of borings that are supposed to be drilled for that project. After clicking the Add Project button, the project is added and a procedure should run that will add the number of borings to the Borings table and generate the boring numbers too (B-1, B-2, B-3, etc). Then the form is supposed to close and the Main form is supposed to open.

However, I keep getting the "Procedure declaration does not match description of event or procedure having same name" error whenever I update the Project Number or Boring Count text boxes. On the After Update event of those boxes, I have the values set to temporary variables (tmpProjectID and tmpBoringCount) which are then supposed to be passed to the procedure...right?

This is the procedure for the OnClick event of the Add Project button:

Private Sub btnAddProject_Click(tmpBoringCount As Integer, tmpProjectID As Integer)

    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Dim i As Integer
    Dim tmpBoringNumber As String
    
    Set db = CurrentDb
    Set rs = db.OpenRecordset("Borings")

    i = 1
    tmpBoringNumber = "B-" & i
    
    Do While i <= tmpBoringCount

        rs.AddNew
        rs!ProjectID = tmpProjectID
        rs!PointID = tmpBoringNumber
        rs.Update

        i = i + 1

    Loop

    rs.Close
    Set rs = Nothing
    Set db = Nothing

End Sub
0 Answers
Related