Grant all privileges to a form object programmatically

W

WR

I wrote Access VBA code to grant all privileges on a
table/query to admin user and it works fine.

Set cnn = CurrentProject.Connection
cnn.execute "GRANT ALL PRIVILEGES ON TABLE mytable1 TO admin"

But when I try to grant privileges on a form object like this:

cnn.execute "GRANT ALL PRIVILEGES ON OBJECT Form1 TO admin"

an error said "Cannot find table or constraint." It seems
that GRANT command works only with table and query. Does
anyone know how to set access permission on form object
programatically ? TIA.

WR.
 
T

TC

You can do it using DAO. Are you able to use DAO? Check the Permissions
property in online help.

HTH,
TC
 

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