Code for Tabs on a Form

  • Thread starter Thread starter LLFK
  • Start date Start date
L

LLFK

I created a page on my form (using Tab Control from the toolbox) called
Maintenance Users Only. I set the visible property for that page to NO.
From another page on the form I have a command button that when clicked runs
an Inputbox to ask the user for a password. If the user enters the correct
password, I want the page, called "Maintenance Users Only" to become visible.
I can't come up with the proper syntax to specify the "Maintenance Users
Only" page. If I wanted a correct password to make a field visible, I would
type [Forms]![FrmMainForm]![fieldname].Visible = 0 but what is the right way
to specify the page?
 
LLFK,

If you wanted a correct password to make a control visible, you would type:
Me.fieldname.Visible = True

It is exactly the same with the page on the Tab Control.

In design view of the form, select the page, and then look at the
properties. In particular the Name property, which will tell you the
name of the page.

Then your code will be like this:
Me.NameOfPage.Visible = True
 

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