G
Guest
Hi all
I’m trying to dynamically modify a module. The idea is start with just a
blank function in the module. The code that I’m trying to write will place
code into the function, execute it, and then remove the lines again, leaving
just the blank function again.
The code to place code in the function, and then delete it when it’s been
run is working fine. The problem is that when I close the database, I get
prompted to save changes to the module. I don’t want this.
I have found that if I use DoCmd.Close to explicitly close the module after
the code runs [in order that I can prevent the Save prompt], the module is
removed from the modules collection and I can’t access it. If I counteract
this by opening it using DoCmd.Open, it opens visibly.
So, is there a way I can open the module where I can edit it dynamically but
leaving it invisible?
Or alternatively is there a way I can specify that I don’t want to save
changes to the module without having to explicitly close it?
Many thanks
David
I’m trying to dynamically modify a module. The idea is start with just a
blank function in the module. The code that I’m trying to write will place
code into the function, execute it, and then remove the lines again, leaving
just the blank function again.
The code to place code in the function, and then delete it when it’s been
run is working fine. The problem is that when I close the database, I get
prompted to save changes to the module. I don’t want this.
I have found that if I use DoCmd.Close to explicitly close the module after
the code runs [in order that I can prevent the Save prompt], the module is
removed from the modules collection and I can’t access it. If I counteract
this by opening it using DoCmd.Open, it opens visibly.
So, is there a way I can open the module where I can edit it dynamically but
leaving it invisible?
Or alternatively is there a way I can specify that I don’t want to save
changes to the module without having to explicitly close it?
Many thanks
David