Form Events - Strange Error Message

  • Thread starter Thread starter David Pedley
  • Start date Start date
D

David Pedley

I have a vba project in which an Access form uses the On
Load, On Click, etc events within its class module.
Everything was going fine until I changed a small portion
of the code. Suddenly the event code was not called and
the message "The expression [On Click] you entered as the
event property setting produced the following error:
Constant expression required".
This applies to all handled events. However, from the
Properties dialog in design view, clicking on the entry
against any event handler, displayed the correct code.
I have tried exiting and re-starting. Also, renaming the
event handler and creating a new one - still the same
problem.
Any idea what is going on here, please and what I can do
to get around it? Access XP developer version.
Regards,
David
 
Sorry - forget it.

It was a compilation error in the new code - nothing to
do with the event handler itself. It was presumably
telling me that it could not execute the handler because
it could not compile its module. Because I had added some
constants with module scope (and the mistake was there)
there was no code to stop on and highlight. Still ... not
the most clear of messages.

David
 
Back
Top