Tabbed subforms not updating

Gkirkup

Registered User.
Local time
Today, 07:46
Joined
Mar 6, 2007
Messages
628
I have a form with a tabbed area, each tab containing a subform. One of these subforms adds records to a table. Another subform shows the totals from that table.
But when I add records, the totals tab is not updated with the new quantities unless I close the form completely and go back in. I tried adding Me.Dirty = False to the subform that adds the records but that makes no difference.
It seems as though the 'totals' subform gets those values as the form is loaded and does not change, even when records are added and then that tab is selected.
How can I get the totals subform to show the updated totals?

Robert
 
Did you try a Requery of the form/subform(s) involved?
 
Which form should I requery? The one that writes the records or the one that calculates the totals? I assume the one that calculates the totals. I did try that, but where do I put the requery? On Open? It almost seems as though all the tabs are queried at the start, and not when you open an individual tab.

Robert
 
On the form that Adds the records. Somewhere after the Add of a record,
do a me.requery.

You could try some debugging by using one or more Debug.print statements to see what is happening.
 
I did try that. Didn't work. I think the problem is with the totals subform. When the subform was displayed (showing the wrong totals), I manually ran the query that drives that subform, and it showed the correct totals! So I think I need to requery the totals subform when the tab is selected. How do I do that?

Robert
 
Yes you could requery that form also.
Can you post a copy of you database? Remove anything confidential/private.
Best to do a compact and repair, then create a zip file.
 

Users who are viewing this thread

Back
Top Bottom