Two Pages in one form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to have two or more pages in the one form? If so;
how do I insert another page and
can I put a condition on the first page that a second page is only opened if
a certain value is selected from a combo box?

Thanks in advance!
 
Hi, Angeline.

In form design view, insert a Tab control, which by default inserts two
pages. Its icon looks like 2 file folders on the Toolbox toolbar.

Then place your controls on the pages as you desire. Set the second page's
Visible property to No.

Then in the AfterUpdate event procedure for your combo box, set the visible
property as appropriate:

If Me!MyComboBox = CertainValue Then
Me!MySecondPage.Visible = True
End If

If you also want this page visible as you browse through other records, add
similar code to the On Current event of the form:

If Me!MyComboBox = CertainValue Then
Me!MySecondPage.Visible = True
Else
Me!MySecondPage.Visible = False
End If

Hope that helps.
Sprinks
 
Sprinks,
Thanks so much for your help.

I caught a bit of a snag after I dragged a combo box, changed the visible
property to 'no'. The second page has the same fields I added in the first
page. So I thought if I delete them on the first page to get ready to add the
other fields I want to add, I noticed they then disappearedo on the first
page.

I am then unsure about how to add additional fields from the table without
using the inital wizard that I normally use when starting up a form.

Thanks so much..
 
Hi, Angeline.

Select View, FieldList to see the fields in the RecordSource of the form.
Drag them from the list to the form to place a textbox bound to that field.
You can also simply place a textbox from the Toolbox (View, Toolbox), and
change its ControlSource to the name of the field.

If deleting a control on the first page also deletes it from the second
page, it must have been in the form header or footer, which is common to all
pages. Place page-specific controls within the Detail section.

Hope that helps. Happy New Year.
Sprinks
 
Hi Sprinks,
I am definately only working in the 'detail' section. When I insert the tab
it bring up two pages Page58 and Page59. If I toggle between then they bring
up all the controls and fields already created. If I delete them after
toggling to the second page they are gone on the first. Any other ideas.

Happy new year to you too!
 
If I toggle between then they bring
up all the controls and fields already created. If I delete them after
toggling to the second page they are gone on the first.

This happens very easily if you put the tab page onto the form after
controls already exist. Dragging controls onto the page doesn't work!
They're not "on" the tab page - they're *in front of it*, logically on
the form itself.

What you need to do is shift-click all the forms which belong on the
first tab page; type Ctrl-X to cut them to the clipboard; select the
desired page by clicking the *tab*, not the surface of the page (the
page should darken indicating that it's been selected); then ctrl-V to
paste the selected controls. Then do the same for the other set of
controls.

John W. Vinson[MVP]
 
I am trying this my form works great with all kinds of controls and after
update event procedures but after I copy and paste controls on to new form
with the pages(tab control) names are all wrong-

Not real clear on where in access you are doing the shift/click - I have
the main/subforms open in design view ? do I select the upper left corner or
select Form option then cut - is not available, tried cutting form from
form list and not able to Past in design view of new form.

What am I missing here????



Thanks,
Barb
 
Back
Top