Shift+F9 and Requery...Event trigger for tabbed subform

  • Thread starter Thread starter Darren Kozey via AccessMonster.com
  • Start date Start date
D

Darren Kozey via AccessMonster.com

I have a summary page/tab that has calculated fields. I want to be able to
update the fields when the page/tab is selected, and I have discovered that
Shift+F9 (manually of course) is the one that's doing the job correctly. F9
alone (Recalc?) does not work, and clears the fields. I think Shift+F9 is
equivalent to a Requery Method, but I am having difficulty getting it to
Requery automatically when the summary page/tab is selected. In other
words, I can't seem to find an event that triggers when this page/tab is
selected. To test, I have just wrote a msgbox line of code in VBA to pop
up, and what I want to happen is when the summary page/tab is selected, a
Requery method is triggered. The summary page is on nested subforms.

Any suggestion?

Thanks,
Darren
 
Try using the On Change event of the tab control.

Sub TabControl_Change()
If TabControl.Pages(TabControl.Value).Name = "Summary" Then
MsgBox "Insert Requery Procedure Here"
End If
End Sub

HTH
 
Hi Jason.


Thanks! I would really have been scratching my head for weeks had I not
found out about this propery.
However, I'm unsure of the syntax to use. If my tab control is
"tabEstimate" and the page I'm interested in is "PageSummaryReport", what
would my code look like?

I am a little confused by what you wrote in your response in terms of the
syntax.

Thanks again,
Darren
 
OK,

I've typed in the code exactly as you had written it and it works great. I
don't understand the syntax though, so I'll have to go do some more reading
on referring to objects.

Thanks again.

Darren
 
Back
Top