login form

D

Diogo

Hi, need help with something
I need a way to filter the displayed data of a second form, based on a login
form designed by Graham R Seach.
I've seen some solutions based on the network login name and some solutions
based on adding users to the access security feature, none of this woks for
me because we work at the clients house and I dont have administrator
privileges.
I need to use the last login name, thats what I need. Can someone help me
please?
Thanks in advanced.
 
R

Rick Brandt

Diogo said:
Hi, need help with something
I need a way to filter the displayed data of a second form, based on a login
form designed by Graham R Seach.
I've seen some solutions based on the network login name and some solutions
based on adding users to the access security feature, none of this woks for
me because we work at the clients house and I dont have administrator
privileges.
I need to use the last login name, thats what I need. Can someone help me
please?
Thanks in advanced.

There are two key factors here.

You need a function that will return the name of the current user. It doesn't
matter what method is used to make that identification (Windows Login, Access
Login, Custom Login), but that value has to be placed (at startup) into a public
variable, hidden form, or database property and a function must exist that can
retrieve that value whenever you need it.

You also need all records to include a field where the user ID is stored when
records are saved. That is the only way you can tell which records belong to
which users.

Once you have both of the above you simply need to save the current UserID into
every saved record and then you can set up your queries with criteria such that
they will only return records where the field value is equal to the value
returned by the UserID function.

SELECT *
FROM TableName
WHERE UserID = CurrentUserFunction()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top