code to change a form's allows?

G

Guest

I am wondering what the code syntax is to tweak a form's allows? Allows
deletions? Allows Adds? etc I know how to do it in the right-clicked form
properties manually, but I need it to be based on conditions.

Reason I need this is because I have one form that all users open.
Depending on their window's username, I have a security table that tells me
what role I want them to have in the database. Depending on their role, some
users have more rights than others on this form. I want to adjust the form
to allow additions for some users, but not others.
 
D

Douglas J. Steele

Me.AllowAdditions = False
Me.AllowDeletions = False
Me.AllowEdits = False

means they can't do anything on the form. This assumes that the code is in
the module associated with the form. You can also use

Forms!NameOfForm.AllowAdditions = False
Forms!NameOfForm.AllowDeletions = False
Forms!NameOfForm.AllowEdits = False
 
G

Guest

Me.AllowAdditions = False
Me.AllowFilters = True
Me.AllowDeletions = False
Me.AllowEdits = True
 

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