[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

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.
0
Conernesto
Asked:
Conernesto
  • 3
  • 3
1 Solution
 
Rey Obrero (Capricorn1)Commented:
from the database objects window,
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
0
 
mbizupCommented:
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.
0
 
Rey Obrero (Capricorn1)Commented:
and, take note that you can not use the name "modExcel.bas", but you can use

modExcelbas  without the dot
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
ConernestoAuthor Commented:
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?
0
 
mbizupCommented:
Is it from another database?

Or an Excel file?

If a database, use the Get External Data options, and go through the wizard to select the database and module.

If an Excel file, just copy/paste the code from Excel to a new module in Access, and delete the old.
0
 
Rey Obrero (Capricorn1)Commented:
right click on the module then select delete

File >external data> import > select the access file

then select the module you want to import
0
 
mbizupCommented:
This is it in Access 2010 -- other versions may look different.  External Data, selecting the Access icon will let you import or export modules, forms, etc from one database to another.

External Data
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now