473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Procedure Declaration Does not Match.

I created a db which works fine in Access 2000 on Win2k, but those who have Access 2003 and XP (and Vista!), get errors running event procedures on a particular form:

The error looks like this:

"The Expression On Load you entered as the Event Property Setting produced the following error: The Procedure Declaration Does not Match Description of Event or Procedure having the same name."

The same errror comes up for all events called on that form, not just the OnLoad event. Nearly identical code on similar forms works fine.

The code for the OnLoad event is below. But it is never actually called. The error comes up before a breakpoint for the code.



Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3.   On Error Resume Next
  4.   Combo178.Value = Coc_ID.Value
  5.   CommandBars("Filter/Sort Only").Enabled = False
  6.  
  7. End Sub
  8.  
It's hard to debug since I don't get the error myself.

The initial code used the Sub declaration created by Access, when you go through the code builder for the event on the properties of the form.

In debugging, we tried various configurations that change whether or not the Sub parameters include "Cancel as Integer" we also tried removing the error handler, since the form that does work doesn't have the error handler.

We have also tried deleting the code for the event procedure and recreating the event procedure again from the form's propert box. and adding the code back in. Also, no luck.

Any other suggestions would be greatly appreciated.

Thank you.
Feb 14 '07 #1
6 16929
Rabbit
12,516 Expert Mod 8TB
That's odd. I have Access 2003 running on XP and from what I can tell, that code should work fine. Have you checked out the other subs? Did you try compiling the code?
Feb 14 '07 #2
That's odd. I have Access 2003 running on XP and from what I can tell, that code should work fine. Have you checked out the other subs? Did you try compiling the code?
I looked at other subs but nothing jumped out. I did notice that if I add an OnOpen event and add invalid parameters tied to built in events, I get the error message not just for the event I was testing with but for others as well, This led me to suspect that there is some other sub out there (or just a bad declaration) which I am not calling, nor can I see in 2000, but for some reason is being called in 2003, and that is causing a domino effect of these errors.

But I couldn't locate such an issue.

I haven't tried compiling the code, since I never really did so in the past with Access apps. But I will try it.
Feb 14 '07 #3
NeoPa
32,556 Expert Mod 16PB
If you try to compile the code on one of these machines then it should report the problem to you (It's Access so don't rely too heavily on the error message - it's often pure garbage :(). It's worth a try anyway.
Feb 14 '07 #4
ADezii
8,834 Expert 8TB
I created a db which works fine in Access 2000 on Win2k, but those who have Access 2003 and XP (and Vista!), get errors running event procedures on a particular form:

The error looks like this:

"The Expression On Load you entered as the Event Property Setting produced the following error: The Procedure Declaration Does not Match Description of Event or Procedure having the same name."

The same errror comes up for all events called on that form, not just the OnLoad event. Nearly identical code on similar forms works fine.

The code for the OnLoad event is below. But it is never actually called. The error comes up before a breakpoint for the code.



Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3.   On Error Resume Next
  4.   Combo178.Value = Coc_ID.Value
  5.   CommandBars("Filter/Sort Only").Enabled = False
  6.  
  7. End Sub
  8.  
It's hard to debug since I don't get the error myself.

The initial code used the Sub declaration created by Access, when you go through the code builder for the event on the properties of the form.

In debugging, we tried various configurations that change whether or not the Sub parameters include "Cancel as Integer" we also tried removing the error handler, since the form that does work doesn't have the error handler.

We have also tried deleting the code for the event procedure and recreating the event procedure again from the form's propert box. and adding the code back in. Also, no luck.

Any other suggestions would be greatly appreciated.

Thank you.
Sounds like it could be a case of 'Orphan Code". This can occur, for instance, when you have code placed in an Event of a certain Object and then you later rename that Object. When you look at the Event Procedure, the code is no longer there. In the Code Window of your Form select (General) in the Object Drop Down and (Declarations) in the Procedure List Drop Down. Now, expand the Procedure List - any 'Orphan Code' will now be listed there along with valid Code. Good luck.
Feb 15 '07 #5
It compiled it, and I found two bits of code on other forms that needed fixing.
Ine was an extra "End Sub" on my start form, one stray "End if" some where else in the project, and an event procedure on a third form for a combo box that no longer existed, the compile error for this one only didn't because there was
a reference to the value of that combo box in the code.

I cleared that up, sent to my user who was having the problem (hence the delay) and received a reply that everything "seems to be working just fine"

so I don't know which of these issues caused the problem, but I seem to be okay, so thank you.all.
Feb 15 '07 #6
NeoPa
32,556 Expert Mod 16PB
No problem :)
I'm just pleased that, between us, we were able to help you resolve your problem.
Feb 15 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Duane Morin | last post by:
I've inherited an XSL transform that I need to squeeze every last millisecond out of (since it's running several hundred thousand times). I've noticed that there are 26 match clauses in the file....
7
by: YGeek | last post by:
Is there any difference between declaring a variable at the top of a method versus in the code of the method? Is there a performance impact for either choice? What about if the method will return...
6
by: Markus Dehmann | last post by:
I have a circular dependency between two classes. The FAQ hint about a forward declaration does not help in my case ( How can I create two classes that both know about each other?) Error:...
6
by: kelvSYC | last post by:
This little bit of seeminly innocent code seems to give me these two errors, all on the line that declares check(). Is there some part of C++ that I'm missing out on? class Condition { public:...
0
by: Daniel | last post by:
will a client application using ado.net get an exception if the command is executing a stored procedure that does a RAISEERROR in its tsql?
1
by: smoi | last post by:
I have two listbox in my Form, one call lstFolders, the other one call lstFiles. I have the functions below: Private Sub lstFolders_DblClick() 'Call FunctionToListFilesInThisFolder End...
6
by: lawrence k | last post by:
Wierd. Go to this page: http://www.ihanuman.com/search.php and search for "yoga" This query gets run: SELECT * FROM albums WHERE MATCH(name,description) AGAINST ('yoga') ORDER BY id DESC
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.