Auto Refresh after changing subform

T

Tom

I need some help w/ a simply process... here's what I have:

1. mainform (frmRRIS_SingleForm) that contains cmdButtton (ControlName =
RecalculateSO)
2. RecalculateSO has "=UpdateSubobjAndCISIDetails()" function in the OnClick
event line
3. when RecalculateSO is clicked the function refreshes unbound fields that
use a query for its value source. The function's code is:

Function UpdateSubobjAndCISIDetails() As Long
Dim strFormName As String
strFormName = Me.Name
If strFormName = "frmRRIS_SingleForm" Then
'Recalculates the DLookup sum of the Subobjectives and CISIs
Me.Dirty = False
Forms!frmRRIS_SingleForm.Recalc
End If
End Function

4. Currently, I always have to push the cmdButton to refresh the data in the
unbound controls. I'd like to have the Refresh done automatically once
data is changed in my subforms.

How do I do this? I thought the following approach might work in for a
field's AfterUpdate event (in subform)... but that doesn't work.

Private Sub SubobjectivePercentage_AfterUpdate()
Me.Parent.RecalculateSO_Click
End Sub


Any ideas how to get this to work properly? Quick recap of current
process:

- value in subform changes
- I must click cmdButton on mainform to view the unbound fields on mainform
show proper values given the change in subform
- how do I automatically refresh mainform w/o clicking the cmdButton on
mainform?

Thanks,
Tom
 
Top