How to use paswords for 2nd and 3rd page

F

Frank Situmorang

hello,.

On my church membership forms I created a tab control
1. 1st page is a general information of the members
2. 2nd and 3rd page is a confidential info of a member

My question is, since the database will be used by many departments in my
database, how can I make that every time they click the 2nd and 3rd tabs,
they asked for the pasword. Or is there any way that htis 2 tabs can be
visible to only chruch clerck and church elder.

Thanks in advance
 
J

John W. Vinson

hello,.

On my church membership forms I created a tab control
1. 1st page is a general information of the members
2. 2nd and 3rd page is a confidential info of a member

My question is, since the database will be used by many departments in my
database, how can I make that every time they click the 2nd and 3rd tabs,
they asked for the pasword. Or is there any way that htis 2 tabs can be
visible to only chruch clerck and church elder.

Thanks in advance

A Tab Control is JUST a way to manage screen real estate. It's not really
suitable for managing security!

Have you set up Access workgroup security on this database? (If it's in 2007
you haven't... it's been disabled). If so you could set up security on your
tables, queries and forms so that the confidential information is visible only
to the authorized people; you may need to have Subforms on the tab pages to
display that information, and you'll certainly need to pull the information
out of the member table into a confidential-information table, probably in a
one to one relationship to the main table.

Even at that, workgroup security isn't as good as St. Peter's golden gate
logbook... it can be cracked if someone is determined and willing to do some
google searches.

John W. Vinson [MVP]
 
G

George Nicholson

Here is one approach, but it is a very low form of security. If this is
truly confidential information, this is probably not a valid approach.
Setup: 1st tab is visible
2nd tab is visible, but its only control (a subform control)
is NOT visible
All other tabs are not visible.

Each time the user clicks on 2nd tab they will be prompted for password,
if not previously provided.

'******** Code Start *********
Private Sub tabMain_Change()
On Error GoTo ErrHandler

Select Case Me.tabMain.Value
' Note: The Select Case is testing the PageIndex value of the *New*
page user has just clicked.
Case 0
'Leftmost tab whose PageIndex =0. This page is always visible
' Do Nothing
Case 1
'User has clicked on 2nd tab
If Me.sctlClients.Visible Then
'Do nothing. If this control is Visible, password has
already been supplied
GoTo ExitHere
Else
'Get password
strResponse = InputBox("Please provide the password required
for general maintenance functions.", "Password Required")
If strResponse = "pa33word" Then
AllowAdminSettings(True)
Else
MsgBox "Sorry, that is not the correct password."
' Return user to 1st tab and exit
Me.tabMain = 0
GoTo ExitHere
End If
End If
Case Else
'Do nothing. Any other value means password has already been
supplied
End Select

ExitHere:
Exit Sub
ErrHandler:
MsgBox "Error in tabMain_Change. " & Err.Number & " " Err.Description)
Resume ExitHere
End Sub

Private Sub AllowAdminSettings(bolTF As Boolean)
Me.sctlClients.Visible = bolTF
' Turn tabs 3-6 visible
Me.tabMain.Pages("pgReports").Visible = bolTF
Me.tabMain.Pages("pgOther").Visible = bolTF
Me.tabMain.Pages("pgDataMaint").Visible = bolTF
Me.tabMain.Pages("pgQueries").Visible = bolTF
End Sub
'******** Code End *********
--If you want to test the Name of the page rather than its Value/PageIndex:
Select Case tabMain.Pages(Me.tabMain).Name

--Form_Open should include the lines (just to be sure everything is setup
right):
AllowAdminSettings(False)
 
F

Frank Situmorang

Thank you George, I will try this.. This kind of security is enough for us.
You know church matters are not so confidential, just not to allow people to
know if the person membership should be excommunicated if there is violation
to the church policies.

I will come back to you if I find a problem on this
 
F

Frank Situmorang

George,

In which event procedure shall we put the VBA, is on click of the 1st Tab?

Thanks for your help
 
L

Linq Adams via AccessMonster.com

When approaching matters of security, you really have to stop and ask
yourself "What kind of data am I protecting and who am I trying to protect it
from?" The answers to these questions should go a long ways in deciding the
security that needs to be implemented.

I would suspect, in your case, that your purpose is to simply prevent lower
level staff from viewing the confidential information, rather than being
concerned about someone hacking the system. If this assumption is accurate,
George's code should do just fine!

Frank said:
Thank you George, I will try this.. This kind of security is enough for us.
You know church matters are not so confidential, just not to allow people to
know if the person membership should be excommunicated if there is violation
to the church policies.

I will come back to you if I find a problem on this
Here is one approach, but it is a very low form of security. If this is
truly confidential information, this is probably not a valid approach.
[quoted text clipped - 75 lines]
 
G

George Nicholson

In my code sample, "tabMain" is the name of the TabControl itself, *not* any
of its 5 TabPages (which are all named "pgXYZ").

The code belongs in tabMain_Change (not Click).

Keep in mind:
1) TabControl.Value contains the TabPage.PageIndex value of the
currently selected TabPage.
2) TabControl_Change fires when TabControl.Value is changed by the user
clicking on a new TabPage (or changed via code).
 

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