From: deb on
Access 2003

I have a form called f018ContrPerf

Is it possible for a tab to be auto created for each UnitNo field I have
within a record?
The tab should contain a form called fUnit and the PK is ProjectID, and
UnitNo?

i.e.
if I display a project record with 2 unitNo's then a two tabs are created
with the fUnit form in the tab areas. The fUnit forms will display the
specific data on eahc unitNo

if I display a project with 3 unitNo's then three tabs will be created...
and so on

--
deb
From: Allen Browne on
You can't generate more tab pages at runtime.

It would be possible to set up the form at design time so that the tab
control has the maximum number of pages you could want, and then write code
in the form's Current, AfterInsert, and AfterDelConfirm events to hide the
pages you don't need.

If you are not comfortable writing code like that, you could just put an
unbound combo box on your form, before the main form record, and above the
subform where you have the related records. Include the combo's name in the
subform's LinkMasterFields property, and the UnitNo field in
LinkChildFields. Then you just choose the unit number in the combo, and the
subform shows that unit.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"deb" <deb(a)discussions.microsoft.com> wrote in message
news:89069097-46DF-4E2B-8202-0C64E9952921(a)microsoft.com...
> Access 2003
>
> I have a form called f018ContrPerf
>
> Is it possible for a tab to be auto created for each UnitNo field I have
> within a record?
> The tab should contain a form called fUnit and the PK is ProjectID, and
> UnitNo?
>
> i.e.
> if I display a project record with 2 unitNo's then a two tabs are created
> with the fUnit form in the tab areas. The fUnit forms will display the
> specific data on eahc unitNo
>
> if I display a project with 3 unitNo's then three tabs will be created...
> and so on
>
> --
> deb