Reloading a subform?

KabirPatel

Registered User.
Local time
Today, 05:37
Joined
Nov 16, 2006
Messages
38
Hi,

I have a form that has a combo box in the "Form Header" section. This form also contains a subform that is bound to a SQL Server stored procedure. The stored procedure takes 2 paramaters. One of the parameters is the value of the combo box.

I would like the subform to reload each time the value of the combo box is changed.

To try and do this I used the following code in the master form:

Private Sub cmbMyButton_AfterUpdate()

[Forms]![frmMasterForm]![frmChildForm].Requery

End Sub

In the child form I added the following code:

Private Sub Form_Load()

Me.InputParameters = "@myVar='" & [Forms]![frmMasterForm]!cmbmyCombo.Value & "'"

End Sub

The idea is that the requery will cause the form load event to fire and hence the input paramater would change with the new value.

I have found out however, that the requery does not cause the form_load event to trigger.

Is there any way to refresh the subform with the new input parameter value each time the combo box value is changed?

Thanks
Kabir
 
Close it and Re-Open the form using code called from the AfterUpdate action. To make sure you come back to where you were, you may need a filter.
 

Users who are viewing this thread

Back
Top Bottom