Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Multiuser / Networking / October 2004

Tip: Looking for answers? Try searching our database.

Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
- 30 Sep 2004 21:47 GMT
Hello,

Is it possible to determine the users network ID from
access and then somehow link this to the information they
are able to view. I would like to prevent particular
groups of users from obtaining access to particular
tables.

Let me know if there are better ways to do this.

Thank You
Nikos Yannacopoulos - 01 Oct 2004 08:22 GMT
The Windows logon name can be obtained by:

Environ("UserName")

which works everywhere (queries, forms, reports, macros, VB code...). The
suggestions below assume that users only access data through forms, reports
etc, without opening the tables directly. To ensure they cannot do the
latter, you will need some VB code to disable the startup bypass key (Shift)
and Show database window key (F11) on your front end. They will still work
without this precaution, but a knowledgable user will be able to gain access
to the tables.

In order to restrict user access to a table's records (at record level), you
need to include a field in the table to store clearence information, such as
the user logon name itself, or a department ID, and make the recordsoyurce
of the form(s) though which the table is accessed a query that filters on
it; if the field stores the user logon name itself then it's just a question
of filtering on the current user's logon name; if it's a department or
workgroup or something, you need a table associating users with departments
(etc), and a DLookup in the filter to get the department based on the user's
network logon name.

In order to provide or deny user access to forms etc. depending on their
logon, you can use some simple VB code in the On Open event (or wherever
applicable) of your swhitchboard (or other form) which enables or disables
the command button(s) opening the forms; this requires a table to hold the
information on what is permitted for each user.

HTH,
Nikos
> Hello,
>
[quoted text clipped - 7 lines]
>
> Thank You
Douglas J. Steele - 01 Oct 2004 22:40 GMT
Environment variables are trivial to reset, though, so I always recommend
against that approach.

The API call, illustrated in http://www.mvps.org/access/api/api0008.htm at
"The Access Web", is far more reliable.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> The Windows logon name can be obtained by:
>
[quoted text clipped - 37 lines]
> >
> > Thank You
- 05 Oct 2004 07:57 GMT
Thank You for your responses. The API function looks like
what I need. However, I am by far not an expert with
Access vba code, I normally work with Excel VBA code.
Once I paste the function into a new module, how do I get
the username into a table or compare it to values in a
table, or would I use the fuction name as my variable
that I am comparing? What would be the best way to use
this and how?

Thank you very much for the help!!

>-----Original Message-----
>Environment variables are trivial to reset, though, so I always recommend
[quoted text clipped - 54 lines]
>
>.
Nikos Yannacopoulos - 05 Oct 2004 09:19 GMT
Having pasted the code in a standard module, you can call function
fOSUserName() just like any Access built-in function, and it will return the
Windows logon name, virtually anywhere in your application: in a calculated
field or a criterion in a query, in the control source or default value
property of a control in a form or report, in code, wherever.

So, to store it in a table, you can do it through a bound form or
append/update query or a recordset uperation in code or...
To compare to a stored value in a table, you would use it in a criterion in
a query, or in a DLookup function, or in code or...

Post back if you need more specific help.

HTH,
Nikos
> Thank You for your responses. The API function looks like
> what I need. However, I am by far not an expert with
[quoted text clipped - 88 lines]
> >
> >.
- 06 Oct 2004 14:29 GMT
Thank You very much!!!

>-----Original Message-----
>Having pasted the code in a standard module, you can call function
[quoted text clipped - 106 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.