Sub Form - Combo Box list not populating according to the Main Form Control

lodhi1978

Registered User.
Local time
Tomorrow, 00:40
Joined
Apr 15, 2014
Messages
10
Hi All,

I am using MS Access 2010,
I have three tables,
Policies (Id, Client Id, Address, Policy Amount, Paid)
Payments (Id, Client Id, Total Amount)
Payment Details (Payment Id, Policy Id, Paid Amount)

I have created a form "PAYMENTS" that include a sub form "PAYMENT DETAILS".

In the sub form control Policy Id is defined as combo box, and retrieving the list from Policies and Payments where Policies.Client=Payments.Client the query of Combo Box is as follows:
Code:
SELECT POLICIES.[POLICY ID]
FROM POLICIES
WHERE (((POLICIES.PAID)=False) AND ((POLICIES.CLIENT)=[Forms]![PAYMENTS]![ClientId]));

Only first time Combo Box display the Policy Ids according to the Client, but when I change the client and always displays the previous clients Policy Ids.

Kindly advice how to retrieve correct list of Policy Ids according to the Input Client in Payments.Client control

Thanks,
 
Sounds like you need to requery the combobox after you update the Client. On the After Update Event of Client on the main form, insert some code to requery the combobox on the subform.
 
I have added the code on Client on After Update event as
Me.[SubForm].[Subformcombo].requery but it did not work
 

Users who are viewing this thread

Back
Top Bottom