Access: sub forms on a tab control

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hi

I have a form that contains a tab control. There are a
number of pages on this control, with each page containing
a sub form.

Here's an example:

Form1 has a tab control called Tab1.
Tab1 has three pages: Page1, Page2, Page3.
Page1 contains SubForm1 - this subform was added first.
Page2 contains SubForm2.
Page3 contains SubForm3.

The problem occurs when I save Form1. Access then sets the
subforms on pages 2 and 3 to be SubForm1, i.e. the subform
that was added first. I end up with;
Page1 contains SubForm1.
Page2 contains SubForm1.
Page3 contains SubForm1.

I have tried compact and repair on the database and that
did not work. I tried building a new database (rather than
editing the existing one) and the same problem occurred.

I've also looked at other databases I have created that
have subforms on different pages of a tab control. Rather
nervously I tried saving the forms, but Access did not
reset the subforms. Phew...

Any ideas as to why this is happening with a new database?

Thanks

Michael
 
You probably did not click on the tab before adding the subform, thus adding it to all tabs. Easily done, I've done it myself. A stupid design by Microsoft.
 
Thanks for the tip.

I've added three different subforms to three separate
pages of the tab control. If I run the form I can see the
correct subforms on the correct pages. When I go back
into design view and save the form, Access then sets all
the subforms to be the same as the first subform added.

After more investigation I've found that Access only does
this with some subforms and not others. I can't for the
life of me find out why this is, nor can I fix it.

If anyone can shed some light on this I'd be so happy :-)
 
Back
Top