Tab control based on query doesn't display

  • Thread starter Thread starter Carrie
  • Start date Start date
C

Carrie

Hi there --

I created a 4-tab control on a form that is linked to a
query containing fields from multiple tables.

When I run the form, the tab doesn't display -- unless
it's in the header in which case I can't enter data on it.

If I build the tab off a form linked to a single table, it
works.

How do I build a tab control that pulls fields from
several tables?

thanks
Carrie
 
Carrie said:
Hi there --

I created a 4-tab control on a form that is linked to a
query containing fields from multiple tables.

When I run the form, the tab doesn't display -- unless
it's in the header in which case I can't enter data on it.

If I build the tab off a form linked to a single table, it
works.

How do I build a tab control that pulls fields from
several tables?

First off you need to get the issues straight. A TabControl is only a way to
organize controls on a form. The TabControl itself is not "linked" to your
data, the form is and the bound controls on it are. Your controls don't even
"care" what Tab Page they are on or whether they are on the TabControl at all.

What you are dealing with is a common problem for forms when bound to
multi-table queries. Forget about the TabControl entirely for the moment. It
is normal behavior for everything in the details section of a form to become
hidden when two things are both true.

1) The form has no records to display. This can be because there really are no
records or simply because a filter has been applied that has no matching
records.

2) The form and/or its underlying RecordSet do not allow the additions of new
records.

Any query with multiple tables can easily be rendered non-editable by nature of
its construction. As you add more tables it is increasingly difficult to end up
with an editable RecordSet. For this reason multi-table queries are not often
used for forms where editing is required. What is more typical is to use
sub-forms within the main form with each form bound to a single table only and
the sub-forms linked to the main by the common field or fields. In this
situation many developers will use the TabControl and place a sub-form on each
page.

If you look at your query directly in Datasheet view, does it contain any
records? Either way, can you make additions or edits?
 
Back
Top