I’m looking to add some basic security to an Access .MDB. What I’d like to do is query Active Directory from VBA (i have this code), then if the user isn’t in the right group, turn off the allow updates, deletions, insertions, for every form in the database. Basically, just allow readonly.
Is this possible? How can I do this in VBA? Is there a way to set this once in the autoexec method instead of on every form?
OR is there another way of providing simple security here? Example?
You can set
AllowAdditions,AllowDeletions, andAllowEditsfor a single form with a procedure like this:To run that procedure for all your forms …
Then call the
SetAllFormsEditfunction from theRunCodeaction of yourautoexecmacro.