I have a main form with a tab control, and each tab has a different subform. Two of the subforms have the same underlying query (a list of projects). I have a button that I want to take the user from the first tab to the second tab, but I want the record on the second tab to be the same as it was on the first tab.
For example, if this is the structure (but between frmMaster and the subforms is a tab control, but I don’t think that impacts what I’m trying to do):
frmMaster
- frm_Sub1 (on the first tab)
- frm_Sub2 (on the second tab)
And a user navigates a certain project on frm_Sub1, I want them to be able to hit a button, and they will be taken to that same project record on frm_Sub2. I can set focus on the second tab (using Forms!frmMaster.form!TabCtl0.Pages(1).SetFocus), but I can’t get the subform on that tab to jump to the correct record. I think it’s just an issue with how I’m trying to reference the subform–any suggestions? Thanks.
Let us say I have a comand button on the main form:
You do not need to refer to a page to refer to the control on that page. Controls are unique to a form. Be careful to use the name of the subform control, not the name of the form contained.
EDIT re Comments
Let us say I have a comand button on the first subform: