Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field level security?

Status
Not open for further replies.

owizard

Programmer
Feb 19, 2002
13
0
0
GB
Hi,

Is it possible to implement field level security in a form?In other words, can security be implemented in such a way that only certain users can modify certain fields?

Example:

Users - A, B

Form 1
------

Fields

Date Info1 Info2 Info3 Info4

Is it possible to implement security in such a way that A can modify only Info3 and Info4, while B can modify all the fields?

I think one way of doing it is to replicate the forms for A and B and locking the fields in A's forms. Is there a better way of doing it without form replication?

Thanks for your kind attention.
 
OWizard:

You could enable/disable certain fields based on the windows user. Use Environ("UserName") to get the current user. Either set up a table of users (if you have a lot of users) or hard code it in the form if you only have a couple of users.

Dim sUserName as String

sUserName = Environ$("UserName")

Select Case UCase(sUserName)

Case "JDOE"

Me.fldField3.Enabled = False
Me.fldField4.Enabled = False

Case "BSMITH"

Me.fldField3.Enabled = True
Me.fldField4.Enabled = True

End SELECT

If your network isn't NT you can use API functions to get the current user.

The security here is very limited, but it should prevent the average user from being able to make changes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top