Apr 13 2009, 09:41 AM
I have a main form with 5 tabbed subforms on it. I would like to have a few of the forms password protected. Is there a way to protect just a few of the tabs in the form so only admin. can access them?
Apr 13 2009, 10:13 AM
Not sure about tabbed forms. I would normally approach this with a swicthboard and an admin button n this, and this then opens a secondary switchboard with the admin option on here. You can also add more protection from here so that certain elements can only be maintained by even less people.
I am not certain you can do this on tabs.
Apr 13 2009, 10:33 AM
If you want to password protect certain pages of the tab control instead of using Jims method, you can use the OnChange event of the control along the lines of (assuming you've left the Page Index numbers numbered 0 thru 4 as you have 5 pages)
Select Case Me.NameOfTabControl
Case 1 'second page of tab control
If InputBox("Enter Passowrd") <> "YourPassword" Then
Msgbox "Oops - sorry, you can't see this"
Me.NameOfTabControl = 0 'go back to first page
'other pages added to Select Case statement here
I don't know where you're getting your password from so I've used a hard coded example and an InputBox in the example, but you can change all that to suit your needs..........
**air code warning!!!
Apr 13 2009, 10:50 AM
I have implemented a similar security arrangement for a schools database;
When the the user logs on to the system, the code checks his access privilidges set in the Staff table and then sets each sub form's 'Visible' property as appropriate.
So although the user can still select between tabs there is no sub form on the tab. It is also possible to make the tab itself invisible - but, IMO, unless you also alter the tab widths, it can look messy if the tabs don't cover the full width of the tab control
Apr 13 2009, 11:46 AM
Thanks for this Alan. I suppose I use more of the Bernie approach where I capture the ID and allow access based on this (or not as the case may be) I also do not use tabs as often as i should do I suppose.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here