Read only properties

G

Guest

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!
 
G

Guest

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.
 
G

Guest

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


Top