J
Jeff via AccessMonster.com
I have a Main form (FR_Main Form) which has a tab control on which I have a
continuous subform (FR_QualityChecks). On the footer of the subform (hidden)
I have some calculations and subtotals which results are used to update a
text box (TabQuality) on the Main form.
I have the following code to update the text box TabQuality on the after
update event of the subform:
[Line] in the following is a combo box on the Main Form
Private Sub Form_AfterUpdate()
If Nz(Parent.[Line]) = True Then
Parent.[TabQuality] = ""
Else:
If [Forms]![FR_Main Form]![FR_QualityChecks].[Form]![0s] > 0 Then
Parent.[TabQuality] = 1
Else:
If ([Forms]![FR_Main Form]![FR_QualityChecks].[Form]![3s]) >
0 Then
Parent.[TabQuality] = 2
Else: Parent.[TabQuality] = 0
End If
End If
End If
End Sub
Everytime I fill out a value on the subform FR_QualityChecks, the subtotal
fields [0s] and [3s] change and based on their value it should update
[Tabquality]
It works except that Tabquality updated only after the 2nd input on the
subform. It is always updating the Main form one entry late
I have tried to requery the subform after input with any or all of the
following code but it makes no difference
Me.Requery
Parent.[TabQuality].Requery
Me.TabQualityValue.Requery
Parent.[TabQuality] = Me.TabQualityValue
Parent.[TabQuality].Requery
Me.TabQualityValue.Requery
Me.Requery
I need theTabQuality to update right after the entru on the subform is done.
Any Idea??
continuous subform (FR_QualityChecks). On the footer of the subform (hidden)
I have some calculations and subtotals which results are used to update a
text box (TabQuality) on the Main form.
I have the following code to update the text box TabQuality on the after
update event of the subform:
[Line] in the following is a combo box on the Main Form
Private Sub Form_AfterUpdate()
If Nz(Parent.[Line]) = True Then
Parent.[TabQuality] = ""
Else:
If [Forms]![FR_Main Form]![FR_QualityChecks].[Form]![0s] > 0 Then
Parent.[TabQuality] = 1
Else:
If ([Forms]![FR_Main Form]![FR_QualityChecks].[Form]![3s]) >
0 Then
Parent.[TabQuality] = 2
Else: Parent.[TabQuality] = 0
End If
End If
End If
End Sub
Everytime I fill out a value on the subform FR_QualityChecks, the subtotal
fields [0s] and [3s] change and based on their value it should update
[Tabquality]
It works except that Tabquality updated only after the 2nd input on the
subform. It is always updating the Main form one entry late
I have tried to requery the subform after input with any or all of the
following code but it makes no difference
Me.Requery
Parent.[TabQuality].Requery
Me.TabQualityValue.Requery
Parent.[TabQuality] = Me.TabQualityValue
Parent.[TabQuality].Requery
Me.TabQualityValue.Requery
Me.Requery
I need theTabQuality to update right after the entru on the subform is done.
Any Idea??