A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

User Logins & Access Levels



 
 
Thread Tools Display Modes
  #1  
Old January 2nd, 2007, 07:01 PM
Jeff Monroe Jeff Monroe is offline
Member
 
First recorded activity by OfficeFrustration: May 2006
Location: San Diego, CA
Posts: 27
Default User Logins & Access Levels

I have a database where I have customized the user login function. My table (tblEmployees) contains four fields (lngEmpID, strEmpName, strEmpPassword, strAccess). When launched, the user selects their EmpName from a combo-box and enters their EmpPassword.

What I cannot figure out is how to get their Access (access level: Admin, User, Viewer) from tblEmployee and use it to limit buttons, forms and user data (allow the user to edit their data in a form, but not see other's).

I tried using DLookup() in the form Load event:

('strAccessLevel = DLookup("[strAccess]", "[tblEmployees]", "lngEmpID = lngMyEmpID"))

But I appear to be way off. I am trying to use lngEmpID determined at login (lngMyEmpID is a variable set in a separate module).

How do I get the data from Access (field in tblEmployees) to use in a form's Load event in order to limit button, form access to non-Admin users? How do I filter tblEmployee data in form based on the EmpID or EmpName logged in?

Thanks.

Jeff Monroe
  #2  
Old January 2nd, 2007, 07:15 PM posted to microsoft.public.access.tablesdbdesign
Rick Brandt
external usenet poster
 
Posts: 4,354
Default User Logins & Access Levels

"Jeff Monroe" wrote in message
...

I have a database where I have customized the user login function. My
table (tblEmployees) contains four fields (lngEmpID, strEmpName,
strEmpPassword, strAccess). When launched, the user selects their
EmpName from a combo-box and enters their EmpPassword.

What I cannot figure out is how to get their Access (access level:
Admin, User, Viewer) from tblEmployee and use it to limit buttons,
forms and user data (allow the user to edit their data in a form, but
not see other's).

I tried using DLookup() in the form Load event:

('strAccessLevel = DLookup("[strAccess]", "[tblEmployees]", "lngEmpID =
lngMyEmpID"))

But I appear to be way off. I am trying to use lngEmpID determined at
login (lngMyEmpID is a variable set in a separate module).

How do I get the data from Access (field in tblEmployees) to use in a
form's Load event in order to limit button, form access to non-Admin
users? How do I filter tblEmployee data in form based on the EmpID or
EmpName logged in?


DLookup("[strAccess]", "[tblEmployees]", "lngEmpID =" & lngMyEmpID)

I should also point out that "home-grown" security like you are attempting is SO
easily bypassed by people who are familiar with Access that it is usually a big
waste of time. For example you do know that the table containing all user names
and passwords could simply be imported or linked to from another file, right?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #3  
Old January 2nd, 2007, 10:41 PM
Jeff Monroe Jeff Monroe is offline
Member
 
First recorded activity by OfficeFrustration: May 2006
Location: San Diego, CA
Posts: 27
Default

Quote:
Originally Posted by Rick Brandt
"Jeff Monroe" wrote in message
...

I have a database where I have customized the user login function. My
table (tblEmployees) contains four fields (lngEmpID, strEmpName,
strEmpPassword, strAccess). When launched, the user selects their
EmpName from a combo-box and enters their EmpPassword.

What I cannot figure out is how to get their Access (access level:
Admin, User, Viewer) from tblEmployee and use it to limit buttons,
forms and user data (allow the user to edit their data in a form, but
not see other's).

I tried using DLookup() in the form Load event:

('strAccessLevel = DLookup("[strAccess]", "[tblEmployees]", "lngEmpID =
lngMyEmpID"))

But I appear to be way off. I am trying to use lngEmpID determined at
login (lngMyEmpID is a variable set in a separate module).

How do I get the data from Access (field in tblEmployees) to use in a
form's Load event in order to limit button, form access to non-Admin
users? How do I filter tblEmployee data in form based on the EmpID or
EmpName logged in?


DLookup("[strAccess]", "[tblEmployees]", "lngEmpID =" & lngMyEmpID)

I should also point out that "home-grown" security like you are attempting is SO
easily bypassed by people who are familiar with Access that it is usually a big
waste of time. For example you do know that the table containing all user names
and passwords could simply be imported or linked to from another file, right?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
--
Rick:

Yes, I understand the risks of doing security this way, but it will serve my purpose for this application.

Thanks for the tip. I will try it out later this evening.

Jeff
  #4  
Old January 2nd, 2007, 11:13 PM
Jeff Monroe Jeff Monroe is offline
Member
 
First recorded activity by OfficeFrustration: May 2006
Location: San Diego, CA
Posts: 27
Default

Quote:
Originally Posted by Rick Brandt
"Jeff Monroe" wrote in message
...

I have a database where I have customized the user login function. My
table (tblEmployees) contains four fields (lngEmpID, strEmpName,
strEmpPassword, strAccess). When launched, the user selects their
EmpName from a combo-box and enters their EmpPassword.

What I cannot figure out is how to get their Access (access level:
Admin, User, Viewer) from tblEmployee and use it to limit buttons,
forms and user data (allow the user to edit their data in a form, but
not see other's).

I tried using DLookup() in the form Load event:

('strAccessLevel = DLookup("[strAccess]", "[tblEmployees]", "lngEmpID =
lngMyEmpID"))

But I appear to be way off. I am trying to use lngEmpID determined at
login (lngMyEmpID is a variable set in a separate module).

How do I get the data from Access (field in tblEmployees) to use in a
form's Load event in order to limit button, form access to non-Admin
users? How do I filter tblEmployee data in form based on the EmpID or
EmpName logged in?


DLookup("[strAccess]", "[tblEmployees]", "lngEmpID =" & lngMyEmpID)

I should also point out that "home-grown" security like you are attempting is SO
easily bypassed by people who are familiar with Access that it is usually a big
waste of time. For example you do know that the table containing all user names
and passwords could simply be imported or linked to from another file, right?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
--
Rick:

It worked, thanks.

BTW: Do you know of any tutorials or guides out there to help me in utilizing the Access Security feature (if I wanted to use it)? I know I need to be careful, because I have seen instances where I had to enter passwords for all of my databases on my computer if I am not careful.

Thanks again.

Jeff
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.