472,354 Members | 1,559 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 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 16752
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,511 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,832 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,511 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
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...

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.