Subform opens with first record blank

erniejay

New member
Local time
Yesterday, 20:34
Joined
Oct 10, 2010
Messages
6
I have a form whose data source is a query that produces a subset of table 1. The subform's data source is table 2 and is linked to the form record by a common ID. When the form opens to its first record the subform is blank although there are corresponding records. If I scroll the form to the next record then go back to the first record, the subform displays the correct data. Except for this form-opening anomaly the form/subform works perfectly. I'd appreciate any ideas why this happens and what to do about it. Thanks. :)
 
it may depend how you are selecting the record on the main form, and how your link is set up. do you use code

if you examine the properties for the subform, is it showing the link correctly/at all? It should show the main form and sub form fields that manage the link.

if you haven't set it up this way, then it might be that you are using the current event of the main form to refresh the subform. But when the form opens it fires the first current event, before the subform is avaialble - so you get a blank subform for the first record.
 
Thanks for your reply. To answer your questions: No code is used. Subform Properties shows correct linkage between master field and child field. No Events are listed in the Properties for either the form or subform. We can live with this with proper instruction to users but I found that users sometimes will enter a new record in the subform because they thought the original one was deleted somehow. It would be best to eliminate the problem if I can find out how. Thanks for your help.
 
Problem solved!! By comparing the properties of other forms and subforms that worked properly, I found the solution. In the subform, the Data Entry property must be set to NO. If set to YES the record does not display. It is confusing but that's how Microsoft designed it.
 
The names of a number of Access properties are misleading, but none as misleading as Data Entry! Common sense would dictate Data Entry has to be set to Yes in order to enter data, but this, of course, is not true! AllowEdits and AllowAdditions set to Yes is all that is necessary for data entry.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom