If No Records in Subform, Parent Form Record doesn't display

M

Melissa

If I don't have any records in a subform, the record in the parent form
doesn't display on my main form. The record is in the underlying table for
the parent form, so I don't understand what the problem is. I'm sure the
solution is simple and I'll kick myself later.

Thanks for the help!
 
D

Dirk Goldgar

Melissa said:
If I don't have any records in a subform, the record in the parent form
doesn't display on my main form. The record is in the underlying table
for
the parent form, so I don't understand what the problem is. I'm sure the
solution is simple and I'll kick myself later.


My guess is that the main form is based on a query that inner-joins the
"parent" table to the table on which the subform is based. In a
main-form/subform arrangement, this is neither necessary nor desirable,
since it excludes any parent record that doesn't have a match. Remove the
child table from the main form's recordsource query.
 
M

Melissa

The underlying query (record source) for the form does not include the child
table in it. Additionally, the record in question shows up in the underlying
query (record source). So this that isn't the problem. Is there somewhere
to establish the relationship between the parent and child? I want to show
all records from the underlying query (record source). Help!
 
D

Dirk Goldgar

Melissa said:
The underlying query (record source) for the form does not include the
child
table in it. Additionally, the record in question shows up in the
underlying
query (record source). So this that isn't the problem. Is there
somewhere
to establish the relationship between the parent and child? I want to
show
all records from the underlying query (record source). Help!


What is the recordsource of the main form? If it's a query (stored or
in-line SQL), what is the SQL of the query? Are you saying that if you open
that query as a datasheet, you can see the record in question, but it
doesn't appear on the form? Maybe the form has a Filter property that would
exclude the record, and Filter On Load is set to yes.
 
M

Melissa

Bingo! There is a filter on it that I'll need to fix. The filter looks at
the PK in an SQL statement that includes the child table. Thanks for you
help!!
 

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