Hide Modules

Summer123

Registered User.
Local time
Today, 16:29
Joined
Feb 9, 2011
Messages
216
Hi,
is there a way to hide modules only in VBA window? i have usear who are smart enough to unhide the "module" option in navigation window... how do i go in VBA and only hide the modules? i still want to them to see the forms and the VBA behind the forms.. but not the module.. is there a way to do this? maybe via VBS code itself???
please help.. thank you :banghead:
summer
 
Well you can create an .accde (the option appears on different places depending on your version of Access), which is an executable-only version of your application.

That, though, will not allow the code to be visible, but I can't think of something that works specifically the way you want it.
 
An Accde as stated above is an extra step to deploy your final product just so users can't get to it.
Another way is to use Citrix and hide all the ways they could get to design mode.
I have one on citrix that during startup - if the User ID is Rx_ then just me gets the ability to dive into code. Everyone else is just a user. It comes in handy for those rare instance where the Windows 2008 server behaves a little differently than windows 7 (development workstation).

Yet another way... just to be tricky if either of those are not an option for you.
Create another DB with just public code modules. In your main application go to Tool References and set a reference to it.
LOL, I don't want to hear about anyone doing this to a project the last day of working some assignment - to confuse those who follow them.

This method of referencing a centrally located module with public functions can be used for both Excel and Access.

Now, if you really want to get fancy... get out your old copy of VB6 or a new copy of a language that allows the creation of a COM+ executable (or DLL). Then set a Tools reference to that... but I digress.

Hopefully, the .Accde is looking very good to you after reading this.
 
While you are in VBA editor do:
Tools (menu bar) -> ProjectName properties -> Protection tab -> check "Lock project for viewing" checkbox -> provide a password -> OK

and... don't forgrt the password :)

Good luck !
 
Well you can create an .accde (the option appears on different places depending on your version of Access), which is an executable-only version of your application.
I'm going to disagree on your choice of words MikeLeBen. It is not an executable only version. It does keep forms, reports, and modules from being modified. However, tables, queries, and macros can still be modified in an ACCDE (and MDE).
 
I'm going to disagree on your choice of words MikeLeBen. It is not an executable only version. It does keep forms, reports, and modules from being modified. However, tables, queries, and macros can still be modified in an ACCDE (and MDE).

Hi Bob :)

Although you are correct, and I am well aware you can edit all the non-coded contents of an ACCDE/MDE, the wording is not mine, but Microsoft's! At least the Italian version of Access 2010 reads "The file will be compiled as an only executable file". Redundant and inaccurate, I know.

So far, though, I believe Mihail's reply is the most spot-on.
 
thank you all for replying.
my main goal was to hide only the modules i created.. this way the user can still get in and create queries but cant touch the code that i have created to run these multiple queries.. does that make sense?

i tried MDE but it doesnt let you create new queries.. you can edit the existing ones..

Would what Rx suggested work?
"Create another DB with just public code modules. In your main application go to Tool References and set a reference to it. "

if so how can i do this?
 
It does, but it only allows you to do so (in v2007, anyway) using the Wizard. You can then go into Design View and modify it, if need be.

Linq ;0)>
 
I wrote up a nice set of instructions, but my company network was so bad, I couldn't even refresh - lost it. So sad.
Here is a short version for you to try.
Create a new DB and save as (remember where)
In the new DB - create a Public Function and a Private function. The Public function can use the Private function (give it a try).
Now, back in your main DB - in a Module - the menu Tool - References - then Browse button on the dialogue box. In the filter below, select the type of Access DB extension (e.g. Accdb) Now go the folder for the New DB, find it and select it.
Close the Tools References dialogue. In the code module select F2 (Object Browser)
In the top <all objects> choose the New Database name. In the object below, the Public Function will show up. The Private function is hidden.

While this won't keep a seasoned programmer away, someone not using the debugger won't just see the obvious referenced code.
I had it open and totally forgot to check. It is likely that the New Database will be assigned its own processor thread and resources.
 
I wrote up a nice set of instructions, but my company network was so bad, I couldn't even refresh - lost it. So sad.
Indeed. Seems to be very useful. Maybe you will give a new try and post this set at all.
 

Users who are viewing this thread

Back
Top Bottom