Grant all privileges to a form object programmatically

  • Thread starter Thread starter WR
  • Start date Start date
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.
 
You can do it using DAO. Are you able to use DAO? Check the Permissions
property in online help.

HTH,
TC
 
Back
Top