Requery Subforms

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I have a form that contains a couple of subforms. All works like I want it
too except that the subforms don't refresh their data unless I move to the
previous record and back.

In the past I have not been successful in getting all the sub forms to
refresh, either automatically or via a refresh button that runs a macro.

Can anyone point me at how to do this please?

Ta.
Bill
 
Bill

How are your subforms related to their "parent"? Have you defined Child and
Parent fields in the properties of the subform control?

If you are doing something in the main form, you could try something like:

Me.subformNameXXXX.Requery

(but this shouldn't be necessary if your subforms are linked Parent/Child to
your main form).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Jeff,

The subforms are linked Child/Master as you say but I think the problem may
stem from the fact that the data on one subform is dependent on data entered
into one of the other sub forms on the same master form.

Regards.
Bill
 
Are you referencing that data using something like:

Forms!YourMainForm!YourSubformControl.Form!YourSubformsControl

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
No the summary subforms that don't update automatically have a query as
their recordsource. They are based on a query because it is doing
calculations such as multiplying quantity by unit cost to give an extended
total and other summary calculations such as overspend etc.

Another subform may be changing, say, the quantity or unit price which
directly updates the table that the above mentioned query is linked to.

I have put a Refresh button on the main form and it is doing the necessary
but would like it to be automatic if possible.

Regards.
Bill.
 
Bill

Your subform's underlying query can refer to values in another subform,
using the (rough) syntax in my previous message.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top