Avatar of Rick Danger
Rick Danger
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Acces 2013: Displaying first record in subforms

In the attached example, which I actually got from another expert, there a 3 subforms used in a master form "F__PPSAccounts". When I open this form it shows the first record of subform "S_ContractYears" and the first record of "S_Guarantees". But the other subform "S_RevSharePmts" doesn't show any records, even though for the combination of the other 2 subforms it should show 4 records. It is not until you click on the second record on "S_Guarantees" then back to the first record that it displays and records.

I need the 3 forms to show the relevant records as soon as the form is open. So in the attached example, when you open the
"F__PPSAccounts" form it should show:
2 records in "S_ContractYears" (416 and 417)
2 records in "S_Guarantees" (15 and 16)
4 records in "S_RevSharePmts" (27, 28, 29 and 34)

It's OK when you click on the second record in the "S_ContractYears" subform, but I need it to be correct as soon as you open the main form please
Microsoft Access

Avatar of undefined
Last Comment
Rick Danger

8/22/2022 - Mon
Dale Fye

From my iPad, so cannot open your db.

Is this 3rd subform linked in a master-child relationship to the main form?  If so, how

If not, what is the query you are using for the subform.  If you are actually using a query in this subform, that is linked to the current record in the two other subforms, then you should have code in the Current event of those two other subforms with requeries the recordset in the 3rd subform.

Rick Danger

The 2nd subform is linked to the first, and the 3rd is linked to the 2nd.
The 2nd and 3rd subforms have tables as their recordsource

The OnCurrent Event on the 1st subform does this:

The 2nd subform has its Master field as: [S_ContractYears].Form![ContractID] (from the 1st subform)
and its Child field as: ContractID
Its OnCurrent Event does this: Me.Parent![S_RevSharePmts].Requery

The 3rd subform has its Master field as: [sfS_Guarantees].Form![GuaranteeID] (from the 2nd subform.
and its Child field as: GuaranteetID
Its does not have an OnCurrent Event.
Rey Obrero (Capricorn1)

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rey Obrero (Capricorn1)

another option is to use the current event of the form "F__PPSAccounts", depending on the way you are using the main form..

private sub form_current()
end sub
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Rick Danger

Thanks for taking the time!