on load form

R

Ryis

I have this code which disables my employee tab if the permissionlevel does
not equal SUPER ADMIN. What i want to do is add another item such as ADMIN
to the if statement...i think I am having one of those days as I cannot seem
to code it properly.

any help would be appreciated

Private Sub Form_Load()
If Forms!SIGNIN.LOGINBACK_subform.Form.PERMISSION_LEVEL <> "SUPER ADMIN" Then
Me.EMPLOYEES_TAB.Enabled = False

End If
End Sub


Thanks

Ryan
 
B

BruceM

Myabe something like this:

Me.EMPLOYEES_TAB.Enabled =
Forms!SIGNIN!LOGINBACK_subform.Form.PERMISSION_LEVEL = "SUPER ADMIN" Or
Forms!SIGNIN!LOGINBACK_subform.Form!PERMISSION_LEVEL = "ADMIN"

Depending on the names of other permission levels, maybe you could do:
Me.EMPLOYEES_TAB.Enabled =
Right(Forms!SIGNIN!LOGINBACK_subform.Form!PERMISSION_LEVEL,5) = "ADMIN"

BTW, I assume SIGNIN is the name of the form. I have added an exclamation
mark (bang) accordingly. Also, I added a bang before the field name. I
think you will need that syntax rather than the dot.
 
N

NTC

depends on your business logic

If Forms!SIGNIN.LOGINBACK_subform.Form.PERMISSION_LEVEL <> "SUPER ADMIN" AND
Forms!SIGNIN.LOGINBACK_subform.Form.PERMISSION_LEVEL <> "ADMIN"
 

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