Update subform/query on tab change...

jsv2002

Registered User.
Local time
Today, 17:44
Joined
Feb 11, 2009
Messages
240
Ok have looked around and its driving me nuts....

Have a main form with several tabs containing subforms, the last tab contains a summary of other tabs eg. built a query to bring together the required information which will later also be used on a report.

Now can get the data to display no problems but if you go back and make changes then go back to that tab it won't update until you click a command button on main page to save/update form.

Have tried putting variations of Requery etc in the OnChange of tab page or OnLoad etc but no joy tried so far:

DoCmd.RunCommand acCmdSaveRecord

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 (outdated I know but tried anyway)

Even used a Select* From Where statement instead of pulling data directly from info which displays data but same problem and really slows form load.

Probably something simple but have gone past the point of patience and moved onto another problem for awhile before start stamping on the keyboard... :o

Using Access 2003 windows Vista.

Thanks in advance for any suggestions - John :)
 
I think we share the same problem. My sub reports that are based on a query (criteria from the main form) only update with a tab change, e.g. not automatically.

I have asked for help too but havent heard anything.
If my post is answered i will share the solution with you :)
 
Thank you likewise :) still working on it so may post back.....

(if I don't go nuts first....)
 
hi

this is the reply i have recieved

Code:
 What code have you tried for the requery on the after update of the other?  If it is on the main form that the criteria is selected, you would need to use something like

Me.YourSubformContainerName.Form.Requery

But it doesnt seem to work for me
 
Depends were you are putting it for your situation my problem is slightly different as the datachange is not in the main form but another subform on a different "Tab Page" and I am trying to force a requery on tab selection/change.

EDIT:

Got it put this in my OnExit event of subform syntax was wrong before so I'm thick....:eek:

Forms!Form1!frmsubCOSHHSummary1.Form.Requery was missing a !

:o must pay better attention :o
 
Last edited:

Users who are viewing this thread

Back
Top Bottom