Hide buttons, checkboxes and subforms based off of login user

N

NeoFax99

OK, I have a database that I am almost finished with, just need this
security put in place. I currently can grab the current user logged
in. I also have a table with this information and some other basic
info such as AccessLevel, first/last Name, Phone and Grade. I would
like for my forms to be able to based off of the current user check
his/her level and show only the applicable input items. i.e. Bob has
AccessLevel User so he would see only user input fields and I as Admin
would see everything. How would I go about this programmaticaly? This
way I can write once and use in multiple forms. TIA
 
M

Matt

OK, I have a database that I am almost finished with, just need this
security put in place. I currently can grab the current user logged
in. I also have a table with this information and some other basic
info such as AccessLevel, first/last Name, Phone and Grade. I would
like for my forms to be able to based off of the current user check
his/her level and show only the applicable input items. i.e. Bob has
AccessLevel User so he would see only user input fields and I as Admin
would see everything. How would I go about this programmaticaly? This
way I can write once and use in multiple forms. TIA

You need to run a query based on the logged in user and store the
returned information in variables. You will then only make certian
items visible (the .Visible property) on the form, based on the
information in the variables.

You should do all of this in the "Open" event of the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top