User can only edit own enteries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I make it that a user can view enteries that that user created in the
form, but not other enteries that were created by other users.
 
Base your form on a query and limit the records in the query.

If you records have a "createdby" field, use that to filter the records.

=CurrentUser() will return the current userid if you are
using User-level security


Rick B
 
one way... and it may not be the best way because I am not all that familiar
with access...
is to add a field to your tables called userid and store currentuser() to
that field when a new record is added. If the currentuser() is not the same
as the userid then you don't allow changes. You might also want to allow a
user in the admin group capability to make changes in case the user quits or
something.
 
of course rick's idea is much better than mine you won't need any code with
his. I'm still learning myself.
 
How do i tell it to not allow change sif "currentuser()" is not the same and
also how would i tell it to allow admins
 
Check out rick's suggestion, it's better than mine.
currentuser() will only work if security is set up otherwise currentuser
will always be admin.

If you set up security, each user will have their own userid. That can be
determined by the currentuser() function. Save that data to a field in your
table. When you run a query use as a parameter the field in your table must
equal the currentuser(). Use a form to access the data, and don't give
access to the original table. A user with admin permissions can change a
userid for a user that quits to a user that is still ther if necessary, that
can be done in a query also.
 
Back
Top