Subform shows blanks but Mainform does not (1 Viewer)

krissy21

Registered User.
Local time
Today, 15:34
Joined
Dec 8, 2016
Messages
21
Hello all,

I have a SubForm created from a query that shows an employee's training based on their EmployeeID. When I open the SubForm, it shows the training with dates applicable but also the training which does not have date (This is what I want). But when I open the MainForm, only the training with applicable dates is showing. Any one have an idea how I can get all the training to show on the MainForm?
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 22:34
Joined
Jul 9, 2003
Messages
16,282
You say:-
When I open the SubForm, it shows the training with dates.....

I assume by this you mean when you open the subform on its own as a stand-alone form.

You also say;-
But when I open the MainForm .....

I assume you mean you open the main form, and on this MAIN form is the subform...


So you are explaining two conditions one where you open the subform on its own, and one where you open the subform as a form placed on the main form?

Please clarify
 
Last edited:

krissy21

Registered User.
Local time
Today, 15:34
Joined
Dec 8, 2016
Messages
21
Uncle Gizmo,

Yes that is correct. When I open the SubForm as a stand-alone form, all the training shows. Those with dates and those without.

When I open the MainForm which carries the SubForm, only the training with dates shows.

I want all of the training to show, not just the ones with dates applicable.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 22:34
Joined
Jul 9, 2003
Messages
16,282
The subform isn't a "subform" it's just an ordinary form. However, when you place your subform on the main form it is surrounded by an invisible control called a subform/subreport control. It's much better if you think about it as a "window" that contains the form. In other words this window adds certain properties to the relationship between the form and the subform (as I said both are just forms) it's only this new intermediate control that makes any difference between the two. The subform/subreport control has some useful properties in particular it has LinkMasterFields and LinkChildFields properties which choose the records in the subform. These records are related to each record in the main form. Whenever a value in the main form's link field changes, Access automatically requeries the subform. You can find this hidden intermediary control by carefully clicking on the edge of what you perceive as a subform.

More information about the subform/subreport control in this YouTube video here:-

Building Search Criteria 11

So I think the differences you note are created by the relationship between this subform and the mainform in this subform/subreport control.
 
Last edited:

Users who are viewing this thread

Top Bottom