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.