G
Guest
Ok, here goes.
I have one form (FrmBatchControl) that has two subforms,
SubFrmTotalCompleted and SubFrmBatchWorkSubform.
Note: SubFrmBatchWorkSubform is not a subform of SubFrmTotalCompleted, they
are both subforms of FrmBatchControl.
On the Lost Focus event of a field (NumberCompleted) in the
SubFrmBatchWorkSubform field, I want to requery the SubFrmTotalCompleted
subform. The purpose is that when I add a line of work, I want the subform
listing the total work completed to be requeried to reflect the amount as
soon as I leave the field.
So it's kind of like this:
Main Form
Sub1----------^----------Sub2
I need the proper syntax to requery Sub1 from the LostFocus action of Sub2.
Here is the code I've been working with:
Private Sub NumberCompleted_Change()
Forms![FrmBatchControl]![SubFrmTotalCompleteSubform].Requery
Forms![FrmBatchControl]![SubFrmTotalCompleteSubform]![NumberCompleted].Requery
End Sub
Private Sub NumberCompleted_LostFocus()
Forms![FrmBatchControl]![SubFrmTotalCompleteSubform].Requery
Forms![FrmBatchControl]![SubFrmTotalCompleteSubform]![NumberCompleted].Requery
End Sub
You'll notice it's actually in the OnChange event and the LostFocus event.
When this runs, I see "Calculating..." in the status bar, but nothing happens
to the form. Only when I save the record, move out of the record, back in to
the record and pass through the NumberCompleted field again does the
SubFrmTotalCompleteSubform actually show the new value.
Does anyone have any idea what I'm doing wrong? Is it the syntax, or do I
need to requery the parent form? I'm lost!
THX for reading my rant and if you respond, THX x 10!
I have one form (FrmBatchControl) that has two subforms,
SubFrmTotalCompleted and SubFrmBatchWorkSubform.
Note: SubFrmBatchWorkSubform is not a subform of SubFrmTotalCompleted, they
are both subforms of FrmBatchControl.
On the Lost Focus event of a field (NumberCompleted) in the
SubFrmBatchWorkSubform field, I want to requery the SubFrmTotalCompleted
subform. The purpose is that when I add a line of work, I want the subform
listing the total work completed to be requeried to reflect the amount as
soon as I leave the field.
So it's kind of like this:
Main Form
Sub1----------^----------Sub2
I need the proper syntax to requery Sub1 from the LostFocus action of Sub2.
Here is the code I've been working with:
Private Sub NumberCompleted_Change()
Forms![FrmBatchControl]![SubFrmTotalCompleteSubform].Requery
Forms![FrmBatchControl]![SubFrmTotalCompleteSubform]![NumberCompleted].Requery
End Sub
Private Sub NumberCompleted_LostFocus()
Forms![FrmBatchControl]![SubFrmTotalCompleteSubform].Requery
Forms![FrmBatchControl]![SubFrmTotalCompleteSubform]![NumberCompleted].Requery
End Sub
You'll notice it's actually in the OnChange event and the LostFocus event.
When this runs, I see "Calculating..." in the status bar, but nothing happens
to the form. Only when I save the record, move out of the record, back in to
the record and pass through the NumberCompleted field again does the
SubFrmTotalCompleteSubform actually show the new value.
Does anyone have any idea what I'm doing wrong? Is it the syntax, or do I
need to requery the parent form? I'm lost!
THX for reading my rant and if you respond, THX x 10!