UNC_Access
Registered User.
- Local time
- Today, 00:54
- Joined
- Oct 24, 2012
- Messages
- 42
Hi!
0. My Goal
1. The Situation
2. Question:
3. Things I Have Tried
4. Possible Solutions
Thanks in advance!
0. My Goal
My goal is to refresh one subform after updating data in another subform.
1. The Situation
A. I have two tables:
B. I have one query:
C. I have three forms:
Table_1: a multiple-record, multi-field table used to enter detailed data
Table_2: a one-record, multi-field table that is used to enter summary data
- Relationship: The sum of one field in Table_1 should match a single data point in Table_2
- Note that the tables are not linked in any way (they should not be linked as they come from different sources)
Table_2: a one-record, multi-field table that is used to enter summary data
- Relationship: The sum of one field in Table_1 should match a single data point in Table_2
- Note that the tables are not linked in any way (they should not be linked as they come from different sources)
B. I have one query:
Query_1: a two-field query of Table_1:
- 1st Field - "Total Amount": Sum of a Table_1 field
- 2nd Field - "Variance":[Sum of a Table_1 field] - [Dlookup of a single data point in Table_2)
- 2nd Field - "Variance":[Sum of a Table_1 field] - [Dlookup of a single data point in Table_2)
C. I have three forms:
Form_0: a form which holds Subform_1 (aka Form_1) and Subform_2 (aka Form_2)
Form_1 (aka Subform_1): a form of Query_1
Form_2 (aka Subform_2): a simple form that is linked to Table_2
Form_1 (aka Subform_1): a form of Query_1
Form_2 (aka Subform_2): a simple form that is linked to Table_2
2. Question:
When I modify data in Table_1 via Subform_1, I need Query_1 in Subform_2 to update automatically.
How should I do this?
I'm thinking I may need to use VBA or SQL, but I honestly wouldn't even know where to enter or copy/paste the code.
How should I do this?
I'm thinking I may need to use VBA or SQL, but I honestly wouldn't even know where to enter or copy/paste the code.
3. Things I Have Tried
I have already tried to associate a requery macro to all events in all of the forms (Form_0, Form_1, and Form_2) - nothing worked.
I have already tried to associate a refresh macro to all events in all of the forms (Form_0, Form_1, and Form_2) - nothing worked.
Any help is welcome!
I have already tried to associate a refresh macro to all events in all of the forms (Form_0, Form_1, and Form_2) - nothing worked.
Any help is welcome!
4. Possible Solutions
A. I think Subform.requery might work, but I'm not sure where to go to write the code, or what code should be written exactly.
B. I think FireStrike's answer in the following link may be correct, but again, I don't know where to copy/paste his code: http://www.access-programmers.co.uk/forums/showthread.php?t=111250&highlight=requery
B. I think FireStrike's answer in the following link may be correct, but again, I don't know where to copy/paste his code: http://www.access-programmers.co.uk/forums/showthread.php?t=111250&highlight=requery
Thanks in advance!