option group security

M

Michelle Lichty

How can I lock down an option group so only one set of
users can modify the data? I'm looking for help with the code.
 
T

Tim Ferguson

How can I lock down an option group so only one set of
users can modify the data?

Give the other users a different form without the option group on it.


Tim F
 
K

Kevin

Setup a user table. Have the user ID and some sort of
group identifier. When you open the form, if the user is
from the group who you want to be able to modify data,
enable the option group. If not, disable the option group.

You will need to run a query as a record set from within
VBA. It would look something like this:

DIM db as database
dim rst as recordset
dim sqlStr as string

sqlstr="SELECT tbl_Users.User_ID, tbl_Users.[WorkGroup]
FROM tbl_Users;"

set db = currentdb()
set rst = db.openrecordset(sqlStr,dbopensnapshot)

if(rst!WorkGroup="Superuser")then
Me!OptiongroupName.Enabled=True
Else
Me!OptiongroupName.Enabled=False
End if

db.close
db=Nothing

Hope this helps.

Kevin
 

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