PDA

View Full Version : How to Get Permissions in VBA



Todd
08-16-2007, 09:29 AM
Good Morning,

I need to reference the current user and that users permissions in VBA.

Something like;

If current user does not have add record permission then

The built in user restrictions for adding new records is a little weak. It does not stop the opening of a add new record form, it just opens the form with no elements. Leaves you staring at a blank form.

Thanks

OBP
08-18-2007, 07:56 AM
Todd, you need to run the queries in the Security MDW file for the Database, you can't access the tables, but you can run the queries in read only mode and get the information that you want.
I can'r remember which queries do what though.
You may also have to set the Tools>Options>View>System Objects to access the queries.

Todd
08-19-2007, 01:23 PM
I see the information, but how do I pull the "current user" ID. Once I have that I can query the MsysGroupList table to verify the user is part of the correct group.

OBP
08-19-2007, 03:21 PM
Todd, Application.CurrentUser