Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening link form, expression error 1

Status
Not open for further replies.

simon551

IS-IT--Management
May 4, 2005
249
I'm getting an error message saying that the "Procedure declaration does not match description of event or procedure having the same name."

Code:
Private Sub memBegDate_Click()
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "membershipsDetail"
    
    stLinkCriteria = "[companyId]=" & Me![companyId]
    DoCmd.OpenForm stDocName, , , stLinkCriteria


End Sub
 
generally means you have a procedure name that is the same as an event. Also use Me.companyId assuming compayId is a control on the current form

see for more information

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Thanks. I'm not really sure what that means but I did change it to me.companyId and it is working. (It seems kind of unstable where it works sometimes but if I open the form new and try it again it doesn't work. Then I open the code source and even just look at it and it then works again.)

The event is called in the code directly - in this case it's the form fields click event. Are you saying I should change the name somehow. I guess I don't really know what the difference is here between the name of the event and the name of the event procedure.
 
This is what it is supposed to mean. Here is a keydown event.

Private Sub object_KeyDown(KeyCode As Integer, Shift As Integer)

If you copy it and mistakenly do this

Private Sub object_KeyDown()

Now you have a Procedure declaration, but as you can see it does not match the description of keydown event or procedure having the same name.

However, after doing some googling there are quite a few bugs associated with this error message. I would try deleting all the code from the module. If there is a lot, save in a text file. Then write or copy the code back in. Compact are repair your database and compile the code as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top