Good morning:
I am hopeful someone may provide some assistance with "re-querying" a control (subform 2) when making a change on subform 1.
I reviewed the following site but I've been unable to identify the correct property/control reference:
http://access.mvps.org/access/forms/frm0031.htm
Allow me to provide some background first:
- Form "F01_MainMenu" = parent/main form
- Form "F02_First_Half" = subform #1
- Form "F02_First_Half_Subtotals" = subform #2
Process:
- Upon opening "F01_MainMenu", locate 4th field [AMOUNT] in subform #1
- Let's focus on 1st record ([PAYEE] = "Utility Company") where [AMOUNT] = $75
- Now, subform #2 shows the subtotals for [ACCOUNT_NUM] "0001" and "0002" equal to $95 and $55, respectively.
- Also, in subform #2's footer, I also display the SUBTOTAL of all account numbers (e.g., $150) as well as the "floating budget" (delta between paycheck of $1000 - the subtotal).
Current Process:
- As of now, the subtotal and floating budget in subform #2 are correctly calculated.
What Currently does NOT work:
- If I were to change the amount (in subform #1) from, e.g., "$75" (Utility Company) to $100, the values in subform #2 are NOT updated.
- That is, subform #2 should immediately show the following changes:
1. [ACCOUNT_NUM] = "0001" should change from $95 to $120
2. [SUBTOTAL] should change from $150 to $175
3. [FLOATING BUDGET] should change from $850 to $825
Current VBA (which does NOT work):
- On subform #1 ("F02_First_Half"), I added an OnCurrent event various line of code. Unfortunately, neither of them are working to accomplish the update.
Code:
Private Sub Form_Current()
Forms![F01_MainMenu]![F02_First_Half_Subtotals].Form.Requery
OR
Forms!F01_MainMenu!F02_First_Half.Form!F02_First_Half_Subtotals.Requery
End Sub
My question:
What VBA needs to be included (and on which form/subform) IOT to update the various $$ amounts on subform #2 when updating/changing the [AMOUNT] value in subform #1?