Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery Subform

Status
Not open for further replies.

dots

Technical User
Jul 13, 2001
24
US
Hi,

I have a main form that contains a subform (child1) which is in datasheet view. The subform is based on a query and all that is on the subform is a combo box for users to select components. If the component is not listed, I have an ADD button on the main form which opens up another form (subform 2) for the user to add a new component. They then
close subform2 and return to the original mainform.

My problem is the new components added in subform2 are not showing up in the combo box on the first subform. The only way they show up is if I close the main form and then reopen it, or if I select Records, Refresh from the toolbar.

I have tried:

On Activate for the Main Form

Me.Child1.Requery
Me.Refresh


In the On Close for the Subform2
Forms![MainForm]![Child1].Form.Requery

In the Add button, after opening subform2, I added
Me.Refresh
Me.Child1.Requery

I even tried adding a Refresh button to the main form, and I received the message....Refresh is not available now.

Can someone tell me what I'm doing wrong here?

Thank you!


 
Thanks anyway, I figured it out.

Instead of trying to requery the child, requery the combo box that's in the child.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top