Login problem

G

Guest

Hi, I'm new to Access so you will have to excuse me if I'm asking something
very basic but I've been locked in this problem a few weeks so I'm desperate.
I work for a small companie and I was asked to develope a small timesheet
database for the companie emploeeys.
I'm using a login form based on the one developed by Graham R Seach and then
I developed a form with some fiels and some command buttons associated to
them, the command buttons run macros that run the now() command. I've tried
to developed the most basic thing so that it would be dummie proof.
The main problem is this, I need to develope a way so that the form were the
employe enter their data only sows their data.
I've seen some solutions based in the network login name and others base in
adding users to the access security, none of this works for us, because we
work at the clients house and we dont have administrators privileges, so I
need a way to fiter results based on the name used in the login form.
Please help! Thanks.
 
A

Arvin Meyer [MVP]

You do not need administrative priviledges to get the network login name of
the currently looged on user, just use the api:

http://www.mvps.org/access/api/api0008.htm

In any case, you must have some type of login name from Graham's login form.
Add a column to your table(s) to store the login name. Capture that name
with a global variable and a function and add that function to your query.

In the Declarations section of a Standard module:

Public strLogin As String

Then the function in the standard module:

Public Function MyLoginName() As String
MyLoginName = strLogin
End Function

and the query:

Select *
From MyTable
Where MyLoginField = MyLoginName()
 

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