I have frmMain with frmSub which performs complex calcs and recommendations when values in the sub are changed. This works fine in the AfterUpdate event of all the relevant fields but I have a separate frmGlobal so that the user can make the same change to all of the records in the subform.
The problem is that after a global change, I need to visit every record in the sub and recalculate all of the recommendations but I can't see where to do this and am struggling because I can't grasp the strategy that I need.
I have tried this…
When frmGlobal!btnCommit is clicked,
Forms!frmMain!frmSub!DoRecalc = True
Forms!frmMain!frmSub.SetFocus
DoCmd.Close acForm, "Global"
then, in frmSub I have tried this in OnGotFocus and OnActivate but the message never appears.
If Me!DoRecalc = True Then
MsgBox "its true"
Me!DoRecalc = False
End If
I have also tried the OnGotFocus of the first control in frmSub.
I understand that Refresh and Requery are the normal way to go but I can see no way that I could manage the complexity of the recommendations within the query of the subforms recordset. The calc's also include looking up data in a settings table.
I can put a button on the frmSub to process all of the calcs whenever the user wants to, but it should be automatic in case the user forgets. Can someone please point me in the right direction even if it's what phrase to search for. Thanks for any suggestions. Mike.
The problem is that after a global change, I need to visit every record in the sub and recalculate all of the recommendations but I can't see where to do this and am struggling because I can't grasp the strategy that I need.
I have tried this…
When frmGlobal!btnCommit is clicked,
Forms!frmMain!frmSub!DoRecalc = True
Forms!frmMain!frmSub.SetFocus
DoCmd.Close acForm, "Global"
then, in frmSub I have tried this in OnGotFocus and OnActivate but the message never appears.
If Me!DoRecalc = True Then
MsgBox "its true"
Me!DoRecalc = False
End If
I have also tried the OnGotFocus of the first control in frmSub.
I understand that Refresh and Requery are the normal way to go but I can see no way that I could manage the complexity of the recommendations within the query of the subforms recordset. The calc's also include looking up data in a settings table.
I can put a button on the frmSub to process all of the calcs whenever the user wants to, but it should be automatic in case the user forgets. Can someone please point me in the right direction even if it's what phrase to search for. Thanks for any suggestions. Mike.
Last edited: