How to Use Recalc

D

DOYLE60

Marsh,
You asked for the original question. Here it is:
___________________________

I have a subform that only partly requeries when I click a command button to
requery it. It only requeries the combo boxes, but not the list boxes.

The main form is unbound and contains the combo and list box filters. The
subform's control source, the query, filters the listboxes by drawing up the
queries the list boxes updates, and the combo boxes by an expression in the
criteria row.
I know that the query of the sub works and that both types of filters work for
two reasons. First, the report is based on the very same query and it filters
the combo and list boxes properly. Second, when I shuffle back and forth from
the form view to the design view and back to the form view again, the subform
is properly requeried, both combo box and list boxes.

The button on the form to requery the sub has code to update the listbox
queries followed by the requery action: Child83.Requery.

How do I supercharge this subform? How do I get it to fully requery? That it
only requeries partly seems impossible to me. I tried looking at repaint,
refresh, and all that, but no go.

Thanks,

Matt
_________________________

Subform Name: InventoryDialogUnitsSub
Subform Source Object: InventoryDialogUnitsSub (Same as name).
Subform Record Source: InventoryTrend10TotalSAPUnitsqry

I tried all these Recalc methods:

Me.InventoryDialogUnitsSub.Recalc
Me.Controls("InventoryDialogUnitsSub").Form.Recalc
Forms("InventoryDialogPrintfrm").Controls("InventoryDialogUnitsSub").Fo
rm.Recalc
Me.InventoryDialogUnitsSub.Form.Recalc
Me.Recalc

Thanks,

Matt
How do I write code to Recalc a subform on an unbound dialog form?

I see two methods:

Forms![Mainfrm]![Subfrm].Form.Recalc
Forms("Mainfrm").Subfrm.Form.Recalc

Neither of these happen to solve my problem, but I'd thought I'd ask.

Both of those are equivalent and correct.

Instead of pursuing this question, you should start a new
question that describes the problem you're trying to solve
and just mention that Recalc didn't take care of it.
 
M

Marshall Barton

Matt,

I've tried to unravel your problem description several
times, churned it over in my mind and can't come up with
someting that I could use to try to reproduce whatever
you're seeing. When I asked you to start a new question, I
was hoping to see something that would help me to better
understand your form/subform/list/combo arrangement, at
least something more than a repost of the same problem I
couldn't follow.

After much thought and because you did say that switching
into design view and back displays the correct stuff, I am
lead to believe that the subform's open/load process is
doing more than just a requery. Therefore, I think about
all I can suggest at this point is that you try explicitly
requerying the list boxes that are not updating when you
requery the subform:

Me.subform.Form.Requery
Me.subform.Form.listbox.Requery
--
Marsh
MVP [MS Access]

Marsh,
You asked for the original question. Here it is:
___________________________

I have a subform that only partly requeries when I click a command button to
requery it. It only requeries the combo boxes, but not the list boxes.

The main form is unbound and contains the combo and list box filters. The
subform's control source, the query, filters the listboxes by drawing up the
queries the list boxes updates, and the combo boxes by an expression in the
criteria row.
I know that the query of the sub works and that both types of filters work for
two reasons. First, the report is based on the very same query and it filters
the combo and list boxes properly. Second, when I shuffle back and forth from
the form view to the design view and back to the form view again, the subform
is properly requeried, both combo box and list boxes.

The button on the form to requery the sub has code to update the listbox
queries followed by the requery action: Child83.Requery.

How do I supercharge this subform? How do I get it to fully requery? That it
only requeries partly seems impossible to me. I tried looking at repaint,
refresh, and all that, but no go.

Thanks,

Matt
_________________________

Subform Name: InventoryDialogUnitsSub
Subform Source Object: InventoryDialogUnitsSub (Same as name).
Subform Record Source: InventoryTrend10TotalSAPUnitsqry

I tried all these Recalc methods:

Me.InventoryDialogUnitsSub.Recalc
Me.Controls("InventoryDialogUnitsSub").Form.Recalc
Forms("InventoryDialogPrintfrm").Controls("InventoryDialogUnitsSub").Fo
rm.Recalc
Me.InventoryDialogUnitsSub.Form.Recalc
Me.Recalc

Thanks,

Matt
How do I write code to Recalc a subform on an unbound dialog form?

I see two methods:

Forms![Mainfrm]![Subfrm].Form.Recalc
Forms("Mainfrm").Subfrm.Form.Recalc

Neither of these happen to solve my problem, but I'd thought I'd ask.

Both of those are equivalent and correct.

Instead of pursuing this question, you should start a new
question that describes the problem you're trying to solve
and just mention that Recalc didn't take care of it.
 

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

Top