Conernesto
asked on
Replace a Module in Access Database
I have a module called modExel. I want to replace this module with a different module with the same name. The new module is modExcel.bas. How do I replace the current module on my database with the new one? I know that you do Alt F11 to open the modules from Access.
An easy way to do this is to
1. Make a backup of your existing database before adding the new code
2. Select ALL and copy all of the code from the new module, and paste it to the old, *overwriting all of the existing code in the original module*
The reason you want to overwrite the existing module is so that you do not have multiple copies of public subs and functions with the same names -- which will cause your code to error on procedure calls because of ambiguous names.
1. Make a backup of your existing database before adding the new code
2. Select ALL and copy all of the code from the new module, and paste it to the old, *overwriting all of the existing code in the original module*
The reason you want to overwrite the existing module is so that you do not have multiple copies of public subs and functions with the same names -- which will cause your code to error on procedure calls because of ambiguous names.
and, take note that you can not use the name "modExcel.bas", but you can use
modExcelbas without the dot
modExcelbas without the dot
ASKER
I want to import my new module. When I go to, File Import if I don't have the .bas extension, I cannot select it. When I save it it doesn't save with the same name that I imported. That is why I want to delete the current module and import the new one. How do I do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
right click on the module then select delete
File >external data> import > select the access file
then select the module you want to import
File >external data> import > select the access file
then select the module you want to import
select Modules
right click on the module modExel and select copy, then Paste, give it a new name
or just rename your module
right click on the module modExel and select Rename