Check to be sure that you do not have two procedures in the form's module,
both with the name Form_Open. If there is more than 1, delete the other(s).
Then, after you've commented out the current procedure, go to design view of
the form and start a new event procedure for On Open property. When you get
to the VBA window, copy the code from the current, commented-out procedure
into the new event procedure. Remove the comment ' characters from the code
steps in the new event procedure. Then delete the commented-out, original
event procedure lines.
Does that resolve the problem?
--
Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
"Miss Teacher" <(E-Mail Removed)> wrote in message
news:6DF940AE-87EE-47FD-AC2E-(E-Mail Removed)...
> Hi!
>
> Thanks in advance for your time.
>
> I have a form that, upon opening the form, I get the following error:
>
> "The expression On Open 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.
>
> *The expression may not result in the name of a macro, the name of a
> user-defined function, or [Event Procdure].
> *There may have been an error evaluating the function, event, or macro."
>
> There are no macros on my form. Initially I tried commenting out each line
> in turn in order to locate the offending line in my event, then I
> commented
> out ALL the lines, leaving the event empty. All this produced the same
> error.
> Only when I commented out the existence of the event entirely did the
> message
> not appear. Here is my form_open event:
>
> Private Sub Form_Open(Cancel As Integer)
> 'ChooseOutcomes.Enabled = False
> 'CriteriaSheet.Enabled = False
> 'Notes.Enabled = False
> 'lstAssessmentName.SetFocus
> 'lstAssessmentName = lstAssessmentName.ItemData(0)
> 'Call lstAssessmentName_AfterUpdate
> End Sub
>
> Why would an empty event cause an error on opening my form?