Requery Control on Subform from Main Form (1 Viewer)

AgentSmith

New member
Local time
Today, 06:29
Joined
Sep 8, 2014
Messages
2
SOLVED Requery Control on Subform from Main Form

Hello.

I have a form called Add New Delgation, i have combo box of Institution names on the main form and a subform for Agreements discussed. with a combo box called agreements. I successfully cascaded the combo boxes so that the agreements discussed on the subform are filtered by their respective institutions on the main form. However i am unable to refresh the list each time a new institution is selected as the Macro will not allow me to requery a control on the mainform from the subform.. I would appreciate any help. I am able to use basic VBA code if i could be provided with one.

Thanks again in advance.

Juan
 
Last edited:

Isskint

Slowly Developing
Local time
Today, 06:29
Joined
Apr 25, 2012
Messages
1,302
Hi Juan,

Can you confirm what control (on what form - main or sub) you wish to update and which control (on what form - main or sub) triggers this?

This should be as simple as putting an update code in the AfterUpdate event of the control on your form, EG
Code:
Private Sub [YourControlName]_AfterUpdate
Forms![YourMain/SubFormName].Requery
End Sub
 

AgentSmith

New member
Local time
Today, 06:29
Joined
Sep 8, 2014
Messages
2
Hi Isskint

Im pleased to say that the information you provided worked, thank you very much.

For the benefit of anyone in a similar situation the control institution name on the mainform updates the combobox agreements on the sub form
 

Users who are viewing this thread

Top Bottom