Senin, 20 Mei 2013

RE: [MS_AccessPros] Re: help in user security level

 

Youssef-

Unless you replace the Ribbon with a custom Ribbon, adding a filter either
in the DoCmd.OpenForm or in the form Open event won't lock out the user.
The form will open Filtered, and the user can simply remove the filter to
see all records. You have to modify the form's Record Source to include the
filter on UserName - which means modifying all your queries.

You can write a function to return the logged-in UserName, then reference
that in each of your queries. Let's say you save the logged-in user name in
a Public variable called gstrUser. Your function might look like:

Public Function GetUser() As String
GetUser = gstrUser
End Function

And your queries would reference that function like this:

SELECT * FROM Orders
WHERE UserName = GetUser()

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Youssef
Sent: Monday, May 20, 2013 3:04 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: help in user security level

Hi Clive,

I'm already added the username in all tables as "My database used for BMW
Egypt ordring materials"
So, my problem is how to autmatically filter the recrods related to a
certian user with "ON OPEN" form action as this action should be general for
all forms.

Thanks in advance

--- In MS_Access_Professionals@yahoogroups.com, "Clive" <zctek@...> wrote:
>
> Hi Youssef,
>
> You will need to store the UserName in all records that have been
> recorded by each particular user.
>
> You can then either filter the records according to which user is
> using the DataBase, or show all the records but allow the user from
> changing only the records that have been entered by him.
>
> Regards, Clive.
>
> --- In MS_Access_Professionals@yahoogroups.com, "Youssef" <youssef2309@>
wrote:
> >
> > I have a multiuser database
> >
> > how to control the user when open a form to "view, edit or delete"
> > ONLY the records that he previously recorded
> >
> >
> > thanks in advance
> >
>

------------------------------------

Yahoo! Groups Links

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar