option group security

  • Thread starter Thread starter Michelle Lichty
  • Start date Start date
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.
 
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
 
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
 
Back
Top