You should have good error handling in your code not only to keep errors from occuring in the database but also to let you know where they are occuring. I use MZ Tools (free, by the way) to insert my Error handling which it then includes the module and procedure name in the message. That way you can track things down a little easier.
But to start off with - are you doing anything in code which a compiled version would have problems with (for example, trying to take a form or report into design view in order to do something with it, trying to create a control on a form or report via code, etc.)?