Hi Chris,
Thank you for your help, but this is too good it lock out user from opening
database with run-time error '3033':
You do not have the necessary permissions to use the 'Tables' object. Have
your system adminstrator or .....establish the appropriate permissions for
you.
but if I comment out the line below it let user open database with no
permission to create new tables and query.
con.Permissions = con.Permissions And Not DB_SEC_CREATE
How can I allow user to create queries but not table? Thanks again for your
help.
"Chris O'C via AccessMonster.com" wrote:
> Run the vba code listed in the security faq to prevent users from creating
> new tables and queries. Do it for both the default admin user and the users
> group. Run the code when logged in as the db owner.
>
> Public Function revokePermOnNewObj()
> Call noNewObjects("Admin")
> Call noNewObjects("Users")
> End Function
>
>
> Public Function noNewObjects(strUser As String)
> Dim db As Database
> Dim con As Container
>
> Set db = CurrentDb
> Set con = db.Containers("Tables")
> con.UserName = strUser
> con.Permissions = con.Permissions And Not DB_SEC_CREATE
>
> Set con = Nothing
> Set db = Nothing
> End Function
>
> If you haven't read the security faq yet, download and *study* it.
>
> http://support.microsoft.com/?id=207793
>
> Chris
>
>
> Patrick wrote:
> >I know how to give/take away user permission for tables, queries, forms,
> >reports and macros, but how do I prevent user from adding new table(s) to
> >database. Any suggestion would be greatly apprieciated.
>
> --
> Message posted via http://www.accessmonster.com
>
>