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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unlock option buttons

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
US
I have an access database that uses option group buttons to select record id's.
Security for users is one 1 of 4 choices

Administrator - full access to everything
SuperUser - full access to everything minus one form
User read write access to most forms
Reviewer read only access to everything

On one form, the users select the record they want to review. Ability to read/write or read only is set in a function where their rights are set depending upon their above roles and is passed as true/false,
Code:
Function ContactInfo(OK)
txtbox1.locked = (OK)
txtbox2.locked = Not OK

All of this works fine with the exception of an option group. Regardless of their role, the option group needs to be available (enabled) so they can select the records to browse. I cannot get the option group to be available. When I click on it as a reviewer (read only), it will not take the selection.
Code:
cboProject.enabled = true
optContract.enabled = true
optContract.locked = false
I did this for each option button but it is still locked.
Prior to this function, the read only users have
Me.AllowEdits = False
Me.AllowAdditions = False
Me.AllowDeletions = False​
How can I allow the option group to be used but do not let the readonly users modify any records?
thanks
lhuffst
 
Away from my 'real' computer, so can't tinker with the option box issue just now.
I have managed to do exactly what you are trying to do ( I think): validate user upon opening DB, then restrict access to fields or rows based on permissions.
I think you will need to lock specific boxes or maybe even a subform (but it sounds like maybe multiple rows are shown?)
A Form_BeforeUpdate event to confirm ability to update may work short-term (messy cuz allows user to type in boxes).

Sometimes computer problems are like genealogy... The answer to one problem leads to two more!
 
Had to change the me.allowedits to true.

True lets you enter a textbox, radio button etc but not make any changes
Works fine now thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top