Requerying subforms

R

rbarfitt

Hi, I have a unbound mainform containing a Tab Control with a subform
on each of 3 Tabs. My problem is after I update a record on one tab I
can't get the other tabs(subforms) to requery. Not so great in VB, but
I try hard. Have lost about 6hrs so far on this.
My last attempt was on the Click Event of the Tab
Control(Pricingrequired)

Private Sub Pricingrequired_Click()
Me!fsubqselOrderInvReqPricing.Form.Requery

End Sub

Can anybody point me in the right direction.
Thanks
Bob
 
B

Barry Gilbert

In the OnCurrent of each subform, you might try
Me.Parent.fsubqselOrderInvReqPricing.Form.Requery

Barry
 
R

rbarfitt

Thanks Barry,
But it doesn't trigger when you do a update a record on a different
Tab and switch back to the Tab. If you do a update on the Tab with
Me.Parent.fsubqselOrderInvReqPricing.Form.Requery on the OnCurrent It
seems to go into a loop for 10 sec so.
 
B

Barry Gilbert

You'd have to add the code to the OnCurrent of each subform to requery
the other two subforms. Keep in mind that this code assumes that the
subforms are not used elsewhere in your app. If so, you'd need to add
an On Error Resume Next before these statements.

The timing issue seems to be a separate one. Does the requery take as
long when you do it directly, like with an F9?

Barry
 
R

rbarfitt

That works perfect. I guess it didn't like requiring is self but does
the other forms great.

Thanks again
Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top