A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Tabs visible, not visible on form load



 
 
Thread Tools Display Modes
  #1  
Old October 31st, 2008, 05:28 PM posted to microsoft.public.access.forms
Ryis
external usenet poster
 
Posts: 36
Default Tabs visible, not visible on form load

Hello,

I have 3 different types of permission levels for my database, when a form
loads i want only certain tabs to show up depending on the permission level,
this is what i have so far which works strictly for "SUPER ADMIN", how do
tell the form if the permission level ="MANAGER" to make 2 or 3 of the now
hidden tabs visible again.

Private Sub Form_Load()
If Forms!SIGNIN.LOGINBACK_subform.Form.PERMISSION_LEV EL "SUPER ADMIN" Then
Me.EMPLOYEES_TAB.Visible = False
Me.PO_LOG.Visible = False
Me.REPORTS.Visible = False
Me.EMPLOYEES_TAB.Visible = False
Me.INCEDENT_ACCIDENT_NVESTIGATION.Visible = False
Me.INTERNAL_AUDITS.Visible = False
End If
End Sub

Any help would be appreciated

Ryan
  #2  
Old October 31st, 2008, 06:54 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Tabs visible, not visible on form load

Try:

Private Sub Form_Load()
Select Case Forms!SIGNIN.LOGINBACK_subform.Form.PERMISSION_LEV EL

Case Is "MANAGER"
Me.EMPLOYEES_TAB.Visible = False
Me.PO_LOG.Visible = False
Me.REPORTS.Visible = False
Me.EMPLOYEES_TAB.Visible = False
Me.INCEDENT_ACCIDENT_NVESTIGATION.Visible = False
Me.INTERNAL_AUDITS.Visible = False

Case Is "SUPER ADMIN"
Me.EMPLOYEES_TAB.Visible = True
Me.PO_LOG.Visible = True
Me.REPORTS.Visible = True
Me.EMPLOYEES_TAB.Visible = True
Me.INCEDENT_ACCIDENT_NVESTIGATION.Visible = True
Me.INTERNAL_AUDITS.Visible = True

Case Else

End Select
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



"Ryis" wrote in message
...
Hello,

I have 3 different types of permission levels for my database, when a form
loads i want only certain tabs to show up depending on the permission
level,
this is what i have so far which works strictly for "SUPER ADMIN", how do
tell the form if the permission level ="MANAGER" to make 2 or 3 of the now
hidden tabs visible again.

Private Sub Form_Load()
If Forms!SIGNIN.LOGINBACK_subform.Form.PERMISSION_LEV EL "SUPER ADMIN"
Then
Me.EMPLOYEES_TAB.Visible = False
Me.PO_LOG.Visible = False
Me.REPORTS.Visible = False
Me.EMPLOYEES_TAB.Visible = False
Me.INCEDENT_ACCIDENT_NVESTIGATION.Visible = False
Me.INTERNAL_AUDITS.Visible = False
End If
End Sub

Any help would be appreciated

Ryan



  #3  
Old October 31st, 2008, 06:57 PM posted to microsoft.public.access.forms
Beetle
external usenet poster
 
Posts: 1,254
Default Tabs visible, not visible on form load

You could use a Select Case statement, i.e.;

Private Sub Form_Load()

Dim strPermLevel As String

strPermLevel = Forms!SIGNIN.LOGINBACK_subform.Form!PERMISSION_LEV EL

Select Case strPermLevel
Case "PEON"
Me.EMPLOYEES_TAB.Visible = False
Me.PO_LOG.Visible = False
Me.REPORTS.Visible = False
Me.EMPLOYEES_TAB.Visible = False
Me.INCEDENT_ACCIDENT_NVESTIGATION.Visible = False
Me.INTERNAL_AUDITS.Visible = False
Case "MANAGER"
Me.EMPLOYEES_TAB.Visible = False
Me.PO_LOG.Visible = False
Me.REPORTS.Visible = True
Me.EMPLOYEES_TAB.Visible = False
Me.INCEDENT_ACCIDENT_NVESTIGATION.Visible = True
Me.INTERNAL_AUDITS.Visible = True
Case "SUPER ADMIN"
Me.EMPLOYEES_TAB.Visible = True
Me.PO_LOG.Visible = True
Me.REPORTS.Visible = True
Me.EMPLOYEES_TAB.Visible = True
Me.INCEDENT_ACCIDENT_NVESTIGATION.Visible = True
Me.INTERNAL_AUDITS.Visible = True
End Select


End Sub


--
_________

Sean Bailey


"Ryis" wrote:

Hello,

I have 3 different types of permission levels for my database, when a form
loads i want only certain tabs to show up depending on the permission level,
this is what i have so far which works strictly for "SUPER ADMIN", how do
tell the form if the permission level ="MANAGER" to make 2 or 3 of the now
hidden tabs visible again.

Private Sub Form_Load()
If Forms!SIGNIN.LOGINBACK_subform.Form.PERMISSION_LEV EL "SUPER ADMIN" Then
Me.EMPLOYEES_TAB.Visible = False
Me.PO_LOG.Visible = False
Me.REPORTS.Visible = False
Me.EMPLOYEES_TAB.Visible = False
Me.INCEDENT_ACCIDENT_NVESTIGATION.Visible = False
Me.INTERNAL_AUDITS.Visible = False
End If
End Sub

Any help would be appreciated

Ryan

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.