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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SIMPLE security 1

Status
Not open for further replies.

kschomer

Technical User
Aug 1, 2000
37
0
0
US
I am looking for a simple solution for some un-sophisticated security. I have tried the MSAccess security without success. Therefore, I am looking for something else. My application is individual's job objectives. Each of 7 people will either update their Excel spreadsheet (which is the linked table) or use the MSAccess form, I developed. Each person can generate various reports from their spreadsheet. The main menu are buttons for the individual job titles. I ONLY want access for each person to be able to go into their own button, NO ONE ELSES. Although I would like Management to have access to ALL. Do you have any ideas for a simple solution for security? I can do Tables; Queries; Forms, Reports and macros... but I am not a programmer who knows how to write programs and work with the modules. Does anyone have any suggestions??? Any ideas are appreciated. Thanks, Karen
 
If you don't want to get into VBA I can get you a macro that should do what you want. Create a new macro, make sure that Conditions and Actions are viewable. Now for your condition you will want to enter this- Environ("username")="[Your NT Login]", for the action use OpenForm. What you are doing is using the Environ function to evaluate the UserName system variable. Let me know if you need any more help.
 
Thank you for your response. I guess I need additional help. I understand your directions, but what form am I suppose to Open under Action? My Autoexec opens the main menu form. Buttons on the Main Menu go to specific sub-menus (for a particular job title). It sounds like the macro Action should openform submenu_whoever. I tried this and I did not get a Message "Your NT Login". Actually, nothing happened. I must be missing something
 
Yes, but. Understand that "Simple Security" === NO (real) security. In a sense, it may be O.K., as the price of the lock should never be ~ the values of the property - and your expectations appear to be quite LOW. On the other hand, a MACRO in Ms. Access as security is more-orless the equivalent of a paper sign "Please respect my privacy"

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Michael, Yes "Please respect my privacy" is really enough security for this particular database. My users are not sophisticated and actually would be confused to see anyone elses objectives. So in this case low expectations are fine. Not to mention that since I am not a programmed my skills in setting up security are limited as well. Thanks Karen
 
To explain- This macro is going to evaluate a Windows Environment Variable, it does this using the Environ function in Access. You can view all the variables set on your PC by going to a DOS prompt typing "SET" and hitting enter- To the left of the equal sign is the variable name, to the right is the variable value. We are evaluating the "username" variable, which is your NT Login- to view this go to DOS and type "SET username" and hit enter. You will need to fill in the NT Login on the macro for it to function correctly. Nothing happened for you the first time cause you had the syntax wrong here. Also note there will never be a message displayed to the user.
For manageability I would put all of the macros in to 1 macro sheet and use macro names to distinguish between them. So each row in your macro sheet would look like this...

Macro Name Condition Action
OpenBobsForm Environ("username")="[NT Login]" OpenForm

Then the expression to refer to the macro would be "Macro1.OpenBobsForm". This is what you would use for your buttons.
All of this allows the macro to control what forms a user can enter based on who they are logged into the PC as.
I hope that's a little clearer than mud...if not let me know and I'' explain a little further.
Good luck Karen!!!
 
Thanks Pezamystik, I understand everything you explained. I went to DOS and did SET and saw set variables. But, when I tried to do SET username I received a Syntax error. I suppose that since my workstation is Windows98 it evidently works differently than NT. Anyway, I didn't have good luck getting this to work. Thanks for the help. Karen
 
Did you ever find your answer on security?

The environ variable will not work on all setups. It does not work for the way we have MS Access 2000 set up on our network, so we have to use a VB module to grab the network ID from the WIN NT network.

I saw a sample of the code in another post on this web site when I searched for the word "environ"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top