password protect a subform

G

Guest

I use a form which has several subforms nested in a tabbed format. I would
like to employ a simple password scheme on one of the tabbed subforms to
limit access to viewing by certain users. I do not need to protect the other
subforms.

Is there a way to force a user to enter a password in order to view or
otherwise make use of the one specific subform?

thanks!
 
A

Arvin Meyer [MVP]

One way is to use a Tab control to display the subforms and use the Current
event of the Form to show them if the password is correct, something like
(aircode):

If InputBox("Enter your Password") = "Hello World" Then
Me.TabCtl0.Pages(0).Visible = True
Me.TabCtl0.Pages(1).Visible = False
Me.TabCtl0.Pages(2).Visible = False
Me.TabCtl0.Pages(3).Visible = False
Else
Me.TabCtl0.Pages(0).Visible = True
Me.TabCtl0.Pages(1).Visible = True
Me.TabCtl0.Pages(2).Visible = True
Me.TabCtl0.Pages(3).Visible = True
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