PC Review


Reply
Thread Tools Rate Thread

Empty "Form_Open" error?

 
 
Miss Teacher
Guest
Posts: n/a
 
      10th Jan 2009
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?
 
Reply With Quote
 
 
 
 
MikeJohnB
Guest
Posts: n/a
 
      10th Jan 2009
What is the name of your form????
--
Advice to Posters.
Check your post for replies or request for more information.
Consider providing some feed back to the response you have recieved.
Kindest Regards Mike B


"Miss Teacher" wrote:

> 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?

 
Reply With Quote
 
 
 
 
MikeJohnB
Guest
Posts: n/a
 
      10th Jan 2009
A thought, is the form based on a query? Have you tried running the source
query, does it show any error? Please ignor my previous post I was thinking
of something else which I don't think applies

Regards

Mike B
--
Advice to Posters.
Check your post for replies or request for more information.
Consider providing some feed back to the response you have recieved.
Kindest Regards Mike B


"MikeJohnB" wrote:

> What is the name of your form????
> --
> Advice to Posters.
> Check your post for replies or request for more information.
> Consider providing some feed back to the response you have recieved.
> Kindest Regards Mike B
>
>
> "Miss Teacher" wrote:
>
> > 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?

 
Reply With Quote
 
Ken Snell \(MVP\)
Guest
Posts: n/a
 
      10th Jan 2009
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?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When is an empty file really empty? Jon Windows XP General 8 21st May 2005 11:21 PM
Empty (NUll) value in cell, not empty string? Jan Kronsell Microsoft Excel Discussion 4 20th Nov 2004 06:09 PM
Re: Empty cell and a the empty String JE McGimpsey Microsoft Excel Programming 0 13th Sep 2004 04:12 PM
Empty CD drive not considered empty? Arun Windows XP Hardware 0 21st Oct 2003 07:31 PM
Can blank cells created using empty Double-Quotes not be empty?? JohnI in Brisbane Microsoft Excel Programming 6 7th Sep 2003 11:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:36 PM.