Referencing a form attached to a navigation tab in Access 2010.
Posted on 2013-06-30
I have a problem that is driving me insane trying to solve.
I am new to Access 2010, but having used VBA extensively in earlier versions, I am familiar with referencing controls on other forms etc.
I think the problem I have relates to the way that the navigation for works. I have 3 tabs and have loaded a form onto each. Two of the forms have sub forms. One of these forms works a treat and I can reference controls via VBA without an issue. However, where I am completely baffled is when I come to reference form 1 (on tab 1) from Form 2 (on tab 2). I had thought that as the foms were loaded into the tabs they were effectively sub forms in the navigation form.
When in design view I click on Tab 1 the form shows which is fine and when I click on the form within tab 1, it is described as a subform and has the name "Client Details" which is correct. When I select tab 2, the correct form (Clients) appears. However when I click on the form it is still described as "Client Details". Having spent half a day pondering this, am I to assume that the Navigation form is effectively just changing the source of what appears to be the "Client Details" to the "Clients" tab a bit like changing the SourceObject of a subform?
When I am in the form on Tab 1 I can pass data from controls into queries etc without problem. However, when I try to reference a control on the forms attached to the other two tabs I can't because the forms are not recognised. I am sure I must just be missing something simple, but it has brought me to a compete standstill.
Just for clarification I am familiar with syntax to reference sub forms etc. The problem here is that in code, the forms on the other tabs appear to be invisible.
I hope I have explained this OK, if not I am happy to clarify.