I have code behind a form that runs a maketable query and then renames the table. We get an error messages that a user "does not have permission to delete" and the debugger stops on this piece of code (the rename). Why are the user's permissions revoked? I never set permissions on any table and the table in question is created anew with the maketable everytime the code runs.
DoCmd.OpenQuery "QmakDOuts" 'makes the table
StrTable = ap_GetUserName2 'gets the user's name from OS
StrTable = left(StrTable,6
DoCmd.Rename StrTable, acTable, "TblDOuts" 'renames table
How can I keep this from happening? Usually, the permission is denied only to the user (I can delete the table behind the scenes) but recently, I was denied access to change or delete the table as well.
DoCmd.OpenQuery "QmakDOuts" 'makes the table
StrTable = ap_GetUserName2 'gets the user's name from OS
StrTable = left(StrTable,6
DoCmd.Rename StrTable, acTable, "TblDOuts" 'renames table
How can I keep this from happening? Usually, the permission is denied only to the user (I can delete the table behind the scenes) but recently, I was denied access to change or delete the table as well.