Read only properties

I

Igor G.

I have table tblEmployees with columns: lngEmpID, strEmpName, strEmpPassword,
strAccess, strGroup
How to some form (example frmTest) make READ ONLY if strGroup = "Visitor"
(example), else form must be READ/WRITE.

READ ONLY PROPERTIES:
------------------------------------------
Allow Edits = NO
Allow Deletions = NO
Allow Additions = NO
Data Entry = NO

Thanks!
 
K

Klatuu

Use the Form's Load event. Check to see if the user is a visitor. If he is,
set the enabled property to False and the Locked property to True for all the
controls you don't want the visitor to use. The combination of Enabled =
False and Locked = True causes the controls to look normal (not greyed out),
but still be unaccessable.
 
K

Klatuu

If you want to use the form properties as you have posted, it is pretty simple:

Dim blnAllow As Boolean

blnAllow = strGroup <> "Visitor"
With Me
.AllowEdits = blnAllow
.AllowDeletions = blnAllow
.AllowAdditions = blnAllow
End With

You don't need to use the Data Entry property. It is not the same as the
others.
 

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

Similar Threads

Last logged name 1
username and password form 3
Login Help 1
Even an error with this code I copied 8
User Logins & Access Levels 3
Trouble opening to blank form 22
Record Locks 0
Forms Read Only Problem 4

Top