Using MS Access/Referencing a field between tabs on a tab control
You had offered some help to me in the past, but I was pulled off the project for many months before I was allowed back on it, so I never got to thank you for that. However, I have another question now.
I have created a form with a tab control on it. Each tab then has at least one sub-form. I have multiple tabs that I need to pull summary data off and show on the main tab. Basically, each tab is a separate task and each contains a calculated field to summarize the number of days taken. I want those values to appear on the first tab, which contains an overall summary of the "project".
My issue is that I can't figure out how to reference the calculated field on each page. Every item on each tab is uniquely named. Here's an outline (names changed to protect the innocent!)
Main form: Project
Tab Control: Tasks
Main tab = tabSummary
Other tabs = tabTask_A, tabTask_B, etc.
Relevant sub-forms: subFrmTask_A, subFrmTask_B, etc.
Calculated controls: These are on the sub-forms. Let's call these Task_A_Days and Task_B_Days
I need to reference Task_A_Days and Task_B_Days and include the value from each one on tabSummary.
I've tried Me![Task_A_Days] as well as Forms![Project]![Task_A_Days] and a few derivatives of these, but keep getting a generic error (usually #Name). These are based on internet searches that I've tried which indicate I do not need to reference the tab control if each item is uniquely named.
I'm thinking I somehow need to reference the parent form before going to the other tab, but I'm not sure of the format.
Thanks for any assistance.
My apologies for the delay.
I would use the following:
See if that works for you.
As a hint, to find the path (syntax). Open a new query in design view, close the table window, then right click in the cell next to 'Criteria' and choose the 'Build' option.
The expression builder window will open. Drill down on the first window until you find the form (or subform) that you want. Easier if you already have the form open. Select that form, then double click on the relevant field in the second column, this will put the path in the top window. Copy and paste and use this where you need it.
I hope this helps. I use this hack often. :0)