• Very strange error: event problems

    Author
    Topic
    #355481

    Hi–

    Acc97/Win95
    Has anyone seen this error before? It’s as if the controls on the form won’t recognize their own event procedures.

    “The Expression After Update you entered as the event property setting produced the following error: Event procedure declaration does not match description of event having same name.”

    Now, the code in the event procedure isn’t really much. I had a form built, and the code was quite happy. Then I tried to add one more control with similar code. The new control produced the above error. After checking it out, I thought maybe my database was corrupt. So I copied all of the objects into a new db. When I tried to open the form, none of the event procedures would work, including the OnLoad. I tried all variants of copying the form (aside from re-creating it from scratch), but it no longer works. A really old version of the form still works, though.

    Here’s an example of the code:
    In On Load, I have Me.lstState.Value = Me.lstState.ItemData(0) (which is supposed to select the first item in my listbox, but it never did work).

    The code in the two combos is something like: Private Sub cboReport_AfterUpdate(Cancel As Integer)
    Dim ctl As Control
    ‘If it’s a custom report, allow selections, but if it’s canned, disable selections
    If cboReport = “Custom” Then
    For Each ctl In Me.Controls
    ctl.Enabled = True
    Next
    Else
    For Each ctl In Me.Controls
    If ctl.Name = “cboReport” Then
    ctl.Enabled = True
    Else
    ctl.Enabled = False
    End If
    Next
    End If
    End Sub

    Does anyone have any ideas?

    Thanks!

    Cecilia 🙂

    Viewing 0 reply threads
    Author
    Replies
    • #524424

      Get rid of the Cancel parameter; AfterUpdate event procedures don’t take any parameters. You’ll get that message whenever your event procedures don’t have the correct number of parameters.

      • #524427

        Thank you thank you thank you!!!!!

        Just getting rid of that fixed everything else! I can’t believe it! (You would think that a problem with one event procedure would only affect that one event procedure, but it affected the whole form! Go figure….)

        Thanks again,

        Cecilia 🙂

    Viewing 0 reply threads
    Reply To: Very strange error: event problems

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: