Password Protect a tab

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using a tab control on my form and wanted to know if you can password
protect a specific tab?
 
Hi SS,

I haven't heard of password protecting a specific tab, but you should be
able to set the visible property of the tab in question, based on the user.
Here is how I do it in a database where I'm using "home grown" security (not
Access User Level Security, aka ULS). In my case, I need to use the
Form_Activate event procedure, but you might try using Form_Load and see if
that works for you:

Private Sub Form_Activate()
On Error GoTo ProcError

'Set visible property for Admin tab and space tab widths appropriately
'(1440 pixels = 1 inch). This code is in the Form_Activate procedure, because
'the switchboard is initially opened in hidden mode via the Autoexec macro,
and
'the global variable gblnAdmin is not populated until the user clicks on the
cmdOK
' button on frmDisclaimer.

If gblnAdmin = False Then
Me.pgeAdmin.Visible = False
Me.tabSwitchboard.TabFixedWidth = 1872 '1.3 inches
Else
Me.pgeAdmin.Visible = True
Me.tabSwitchboard.TabFixedWidth = 1584 '1.1 inches
End If

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in Form_Activate event procedure..."
Err.Clear
Resume ExitProc
End Sub



Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
Hi Tom,
Thanks for the help. I will try to tie that type of function into my
CurrentUser function.

Thanks again!
SS
 

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

Back
Top