Form Events - Strange Error Message

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top