Prevent modifying fields by other users

I

Iram

Hello.
I have a form that when someone adds a record their Login ID is inserted
into a field automatically using the 'Username' Module code and the callout
of =fOSUserName()

This database is shared by many folks. I want to lock these fields so that
only the person that created the record can modify these fields. What I mean
by this is that I have a field called "Transfered To" where you can select
another UserId and that person will see it on their screen.
If I transfer a record to another user I don't want them to modify my
original info in the fields however they can only modify the other fields on
the form.

My ignorant logic of writing a vba logic for these fields is this...
On Double Click, If "Transfer To" equals me (=fOSUserName()) then lock this
field.
This is an example of a field that I don't want the person the record is
transfered to to modify this field, however they can modify the other fields
in the form.

Sorry for the redundancy, I am a dork.
Can you help me write this logic in VBA?
Thanks.
Iram/mcp
 
A

Arvin Meyer [MVP]

It becomes very easy if you store the value from fOSUserName in your table,
then you can use it as a condition. The easiest was to store it in a table
is to add the field to a form's textbox, and set the textbox DefaultValue
property to:

=fOSUserName()

Then in your queries, use fOSUserName() at the criteria, and each person
while then only see the records he or she created.
 
I

Iram

Actually I want the record to be shared by both people, by the one who
created the record and the one who is accessing it later. There are 10 fields
in each record. The person creating the record fills in the first 5 records
and the person that accesses it later fills in the other five records.
I want vba code on each of the first five records to say something like...
If fOSUserName is not me keep locked otherwise unlock.

Does this make sense?

Iram/mcp
 

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