Subform is not visible when the main form opens

D

dynamic dd

I am having great difficulty with the subform and it's nested form
disappearing when the main form opens. When I switch to design view it
reappers . This is my main data entry form and the heart of the database I
have created. Does the control source for each form have to be the same? I
have the main form's control source as the main table and the subform's is a
query and the nested form is another query. Is this correct?
 
J

J_Goddard via AccessMonster.com

Hi -

If I understand you correctly, you have a main form, a sub-form, and another
sub-form on the first one, i.e. three levels - is that correct?

If your sub-form seems to "disappear" when the main form opens, it probably
means that there is no data (records) for the sub-form to display. You can
fix that by having the Data Entry property of the sub-form set to "Yes". If
the subform will be used for data editing or viewing as well as (new) data
entry, then you will have to set the value of the DataEntry property of the
subform to "yes" or "no" in VBA.

The record source (I assume that's what you mean by "control source") of the
main form and sub-form(s) does not have to be the same, in fact it would be
unusual for it to be the same. The commonest scenario (but by no means the
only one) is for the sub-form to have the "many" side of a one-to-many
relationship as its record source. The source can be a query, but if so it
must be updateable (unless you are just using it for display purposes).
Using a query as the record source won't work for a form used for data entry
unless the query is based on only one table, in which case you might just as
well use the table as the record source.

John
 

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

Top