PDA

View Full Version : Solved: Error: "The expression On Change you entered as the event property"



andysuth
10-27-2008, 05:29 AM
Hi,

I was very close to finishing this project off and then I started getting this message box every time an event was triggered (onClick or onChange):

"The expression On Change you entered as the event property setting produced the following error:


* The Expression may not result in the neame of a macro, the name of a user-defined function or [Event Procedure].
* There may have been an error evaluating the function, event or macro.
{show Help}
"

Has anyone any ideas as to what I need to do to get this Form Working again?

Is this a symptom of too many functions in one module or similar?

What does it mean "May not" does it mean "Forbidden" or does it mean "It currently does not, but it should"?

Thanks,

-Andy.

CreganTur
10-27-2008, 05:50 AM
Sometimes this can happen if you manually create the Event wrapper for code in a Form. Meaning that you wrote the 'OnChange' instead of letting the VBE create it for you (by clicking the build button next to the event on the property sheet you want to work with, or using the dropdowns on the VBE).

If that isn't the issue, then you need to try compacting and repairing your DB. If that doesn't work, then import all of your tables, forms, etc into a brand new database.

HTH:thumb

andysuth
10-27-2008, 06:04 AM
Thanks,

I'll go through all fifty "onChanges" on the pull downs and see if I can get this working.

At times like this I kick myself for not doing more regular back ups of the project.


-Edit-

I've just been through and deleted a load of functions, and what's left seems to work without crashing and giving error messages, so I guess I just go back through adding in the functions in a more logical and methodical fashion!

Thanks for the advice.)
-End of Edit-

Cheers,

-Andy.

andysuth
10-29-2008, 05:19 AM
I think it was because I had a subroutine named the same as a CombiBox.

"Panelprice"

which refered to the object:
me.panelprice

and the routine

sub panelprice()

so I changed the routine to:

sub panelpricer()

Thanks for your help.

-Andy.