Not sure if this has been considered...but maybe an alternative thought process is required.
After wrestling with code for various applications a few years ago I started down a different path, using tables and so on instead. In this case I am suggesting, in case it hasn't been considered...