require password for certain field entries

F

FishMan

Hi
I have a BD setup with user level securities. Its pretty simple, 1
admin (me) 2 full data users, and 1 Read-only user. But I also want to
be able to restrict individual data users in their inputs to certain
fields.

I have a field 'Checked by' which at the moment takes the names of
the data users as inputs. However I want this field to be password
protected such that an input box appears and asks for a password when
data is entered. The password is put in by the user and the field
filled with the user name corresponding to this password.

I'm still a bit of a newby so nice and simple please!

Fishman
 
R

Rick B

Since the user already entered their password when they opened the file, why
would you require them to enter it again? Simply populate the field your
self using =currentuser() It will fill in the userid of whoever is
signed into the file.
 
C

Chris Mills

In addition to Rick's necessary suggestion (populating with CurrentUser or
some other "authority"), you should investigate "RWOP" queries (Read With
Owner Permission)

Otherwise, there's no real restriction on what they can see.

CurrentUser may be unsatisafactory, for instance if and when the staff
changes. It says who entered it, not who should have access to it.

It is better to decide they are a member of a "group", to which some
data-access is allowed, and then present data or not as appropriate. To have
to enter passwords additional to the logon, is I think "inappropriate".

It is better, if possible, to not even alert the user that there's additional
stuff they're "denied". "What they don't know can't hurt them" type of
principle.

Chris
 
T

TC

I initially thought Rick's answer was correct. However, I suspect that
you want a user to be able to enter some /other/ user's password, to
say that the record had been checked by that other user. Eg. Tom enters
Dick's password, to say that the record had been checked by Dick.

Is that correct? If so, Rick's approach is not what you want. If NOT -
ie. a user would only ever enter their own password - then Rick's
approach is correct.

HTH,
TC
 
F

FishMan

I think its the current user I want, a la Rick. I only want Tom to be
able to be entered in the field if Tom is loggod on. No-one else should
be able to enter Tom into the field, just their own names. Will give it
a try.
 
F

FishMan

Well, it's so easy when you know (or are told) how! As I said I am a
newby to Access and am learning by clicking things as I go. I had not
come across the =CurrentUser() before but it does exactly what I
wanted, Thanks Rick.

For those other newbies:
Just put =Currentuser() in the validation field on a form and the only
thing that can be entered is the log-on name of the user, just what I
wanted. Now no-one else can enter a name other than their own.

What a great thing these groups are ;-)
 
T

TC

I'd just have a checkbox. The AfterUpdate event of the checkbox would
store their username into the record. Then, they'd only have to tick
the box, to mark the record as checked by them.

HTH,
TC
 
F

FishMan

Even better suggestion from TC, will try that as it saves them having
to type (or remember their name!!)
 
T

TC

Make sure you check the state of the checkbox. If it's True, then of
course, you want to set the name. But if it's False, ie. they
/un-ticked/ it, you need to erase the name.

HTH,
TC
 
S

Secret Squirrel

I have a follow up to this discussion... I like the idea of protecting fields
like this but how would you create something where only one person can enter
anything into a field? For example I have a form that multiple people use and
there is a date field that is supposed to be signed off by only the CEO.
Since everyone has access to data entry into this field then anyone can enter
info into this field as well. Can you protect it so only a specific user can
enter info into this field?
 
J

Joan Wild

In the open event for the form
If CurrentUser() = "CEO" then
Me!ControlName.Visible = True
Else
Me!ControlName.Visible = False
End If

You would substitue the Access username for CEO in the above and the real
name of the control for ControlName.
 
S

Secret Squirrel

But what if I want the field to always be visible so everyone can see when it
is filled in by the CEO? And still only be able to be accessed by the CEO.
 
S

Secret Squirrel

Ok I tried it but I'm getting a run-time error 438
When I debug it goes to this line of the code:

Me!CEODate.Enabled = False

Am I missing something here? It looks correct to me.
 

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