Subform problems!

P

Patrick

Well, I want to have a list of employees in datasheet view in a main form of
mine. I decided to use a subform, so I gave the subform in datasheet view
values from a query. When I put the subform into my main form, everything
works correctly, except that I only get the first record. I went ahead and
opened the query to see if it was correct and all the records came up.
Someone please help me?

Thanks
Patrick
 
A

accessjunky

There could be a number of reasons for this but I would expect most to be
related to the LinkMasterField/LinkChildField property of the subform control.

When viewing the query all of the records will be returned, even if it is
viewed via the RecordSource property of the form that is the subform.

When viewing the data in the subform from the form view of the main form,
the records will be restricted to show:

only those records from the subform RecordSource that have the value in the
field shown in the LinkChildField property...

....equal to the value in the main form field shown in the LinkMasterField
property.

(the sentence was getting a bit long so I've broken it down into chunks!).

You probably know this but getting one record only would indicate that either:

1. There is only 1 record in the subform table related to the main record.
2. That either of the LinkMasterFields or LinkChildFields is wrongly set
(particularly check this if the wizard suggested the link as the names used
in the tables may have caused a link different to that which you expected).

I hope this helps
 
Top