Access VBADiscuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Internally, access keeps a reference to the files used for string VBA code. Some times this references get corrupted and access can not find the file, even if you can open the code. This happens a lot (almost every time) when an access object that contains code gets imported into a database. Always remove the code from the object before importing into an access database.
The only way to fix this is to create a new database and import all of your objects into it. Copy the code into separate text files and under the object properties in design view, select hasmodule and click no.
Make a good backup before you begin this process. Yes, this has happened to me many times. :(
Use code modules more. This can be imported with no problem. Access is a good program, but it tries to do too much, and sometimes overtasking will kill you.
I use am using access more for the reporting than the forms. I do not keep data in access whenever possible.
make sure to decompile your file as well. This will reduce the possibility of bugs in your code. Do a search on this forum for "decompile" I do not remember it from the top of my head, but you run it from the command line.