Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lock out your form so only you can go into design view and no one else

Status
Not open for further replies.

zishan619

Programmer
May 28, 2003
284
MX
Hi everyone:
I had major problems with people going into my forms and adding controls that I did not want there. So I created a function that would kick the person out of the form if he/she goes into the design view of the form.
If Me!WinUserName = "yourusername" Then
Else
On Error Resume Next
DoCmd.Quit acQuitSaveAll
Application.Quit
End If
The WinUserName function is actually another module to get the your or anyone's username for the workstation they are on.
I think the function is posted on Tek-Tips but I forgot where.
But this will help to keep your form secured.
Cool
 
Couldn't you have just opened your database, click on Tools, Startup, specify a form to open at, and take ALL the checks out? Then when you wanted to do more development, you would just hold down the Shift key then open your database. Holding down your shift key bypasses the startup options. Just don't tell anyone about it.

Neil
 
Yeah we could do that but sometimes a person in the reporting world may need access to the tables, queries or anything else. It depends on the situation. cool
 
Actually, you would be much happier if you just used front end/back end technique. That way your forms can not be opened in design view, but your tables can be accessed by someone in the reporting world. The "shift" trick only works when you are dealing with non-techies that don't take the time to read the help files. If you don't want another developer hacking your app, you should use FE/BE before releasing it.
 
How do I create a Front End backend Database?
 
Search Access help for "Split Database". This should point you in the right direction.
 
You can still open forms in design mode with a FE/BE architecture ... If you really want to lock users out from designing forms, use the Fe/BE architecture and make your FE an .mde file .... This type of file (it still keeps your .mdb file) will not let any users into design mode and should be effective in protecting your app from annoying internal users who feel they need to change your program.

Tools > Database Utilities > Make MDE File ...

Good luck!

-Jedi420
 
That's right, forgot to mention that was the reason for splitting in the first place. Create MDE file from the Front End. Make sure to keep the original intact(do not delete it !!) Once you go MDE there is no turning back. So you will need your original MDB to make changes/updates as needed and as long as you don't need to make changes to your table designs(add/remove columns, etc.), you will be able to just copy the new MDE file over the old one and it will work fine. ALSO:(linked table locations should not be changed, if so then you will need to relink you tables again to the FE)

 
Hey, I just found a way to hack into an mde so that it can be designed. Just wanted to share. If you have an mde, you can actually design forms by pressing Ctrl+G, which will take you to the code window. From here, you cannot edit or even view any code, but notice the design mode button that has been conviniently placed in the toolbar. Press that and you're back in design mode of the form you were on!

This is quite harmless actually since design changes cannot be saved and the form will automatically return to its original state once you close and re-open the form. I imagine this can be circumvented by shutting off the special keys, but who wants to do that! ;-)

-Jedi420

A man who has risked his life knows that careers are worthless, and a man who will not risk his career has a worthless life.
 
Oh man!! If you hold shift and open your mde, you get to see the project window (which is not TOO bad), but you can also make new queries and modify old ones! Geez! I think for releases, Im gonna shut the special keys option off!

-Jedi420

A man who has risked his life knows that careers are worthless, and a man who will not risk his career has a worthless life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top