tab control

C

Carol Shu

how to create a passwoard to a tab page, example, I have 5 tab pages, I would
like to keep page 4 in private, have to have passwoard to view fields...any
idea, thanks
 
A

Al Campagna

Carol,
Make the tab Page Visible = No in design mode, and use the main form to
prompt the user for the password. If password OK, make the Page Visible =
Yes.
Note: If a user just viewed the hidden tab page via the password, and
then moves to another record, that tab Page would still be set to Visible =
Yes (from the previous Visble = Yes... so... use the OnCurrent event of the
form to always make sure the tab Page is set to Visible = No as the user
browses from record to record.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in your life."
 
G

George Nicholson

In the TabControl's Change event, test for the value of the TabControl. This
represents the tab/page the user is trying to move to. If the value is the
same page as the one you are trying to protect, ask for a password. If not
suppled, reset the value to a different tab/page.

(In MyTab_Change)
If MyTab = 3 Then
' User is trying to move to 4th tab (zero based counter)
strPwd = Inputbox("Please enter a password")
If strPwd <> "pa33word" Then
' Wrong password. send user to 1st tab (zero based counter)
MyTab = 0
End If
End If
 

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