Change the code to point to the mde file instead of using currentdb, which is
only useful in the current db file.
Change this line of code:
Set db = CurrentDb()
to this:
Set db = OpenDatabase("C:\Data\db.mde")
or whatever path and file name you choose. This code resides in a module in
a db file that *isn't* your mde file.
If you want it to be reusable and not hardcoded, put a text box on a form.
Read the value the user typed in the form for the path and file name to turn
on/off allowbypasskey for that db file.
Chris
"Harvey" wrote:
> Hello:
>
> We ship our app (acc 2003) as .MDE and would like to incorporate either of
> the solutions for preventing a user from pressing SHFT (to bypass an Access
> application and see the back end database):
>
> http://www.members.shaw.ca/AlbertKal.../msaccess.html
> or
> http://support.microsoft.com/kb/826765#appliesto
>
> both of these work on the .mdb, but how would I do this with .mde? Once
> bypass key is run, the menus are no longer available, so I can no longer
> create the .mde. is there a command line tool to create the .mde? or some
> other solution someone might be aware of?