Interesting observation, Baz, but I'm not seeing it.
I do see the empty event procedure removed when I compile.
That happens even if it is the last proc in the module, and the compile
succeeds.
Wonder what's different. Do you have Service Pack 1? I tried in the the
module of a form, using Access 2007 SP1 on Vista, starting msaccess with
RunAsAdmin. I also have Compile On Demand turned off (Tools | Options |
General, from the code window.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Baz" <(E-Mail Removed)> wrote in message
news:478dc273$0$13929$(E-Mail Removed)...
>I have discovered another bug in Access 2007.
>
> In A2007, empty event procedures are automatically removed when you
> compile. This is A Good Thing, because of all the empty event procedures
> that Access automatically creates. In earlier versions, these had to be
> manually deleted if unwanted (or ignored if lazy).
>
> However, in A2007, if said empty procedure happens to be the *last*
> procedure in a module, compiling fails silently (without removing the
> procedure), and if you then make an accde (or mde) file, it will appear to
> have been sucessfully created *but no code will run in it*.
>
> The solution is simple: track down and delete the empty procedure.