A
Al Camp
Hello all...
I have a main form (frmMain) with a continuous subform (frmSubform). The
subform contains "disbursement" records against a frmMain form OrderAmt.
(basically... multiple subform entry of lengths of fabric vs. an OrderAmt).
When the Sum of subform disbursements (in a calculated field
[TotalDisbursed] in the subform footer) meets or exceeds the order amount,
that order has been "filled", and I lock (enabled = false) the subform from
any more disbursements.
My subform code keps track of the amounts disbursed as records are added,
and alerts the user that the disbursement is "incomplete", "complete", or
"over-disbursed" and... when applicable, moves the focus out of the subform,
and locks it. That all works fine.
Problem...
However, as the user browses between Main form records, I need to also
need to check this "status" and lock/unlock the subform accordingly. Some
orders are filled... some are not.
Using the Main form OnCurrent event... when I ask what the value of
TotalDisbursed is, there never seems to be a value. Seems as though the
Subform and Main haven't "connected" at that time. When the form comes up,
all the values are correct... but there appears to be no TotalDisbursed
value at OnCurrent time.
OnCurrent...
If Me![frmSubform].Form![TotalDisbursed] >= Me.OrderAmt Then...
'locking code
Else
'unlocking code
End If
Can anyone give me suggestions as to what's going on here, and how I
might be able to perform this OnCurrent checking?
Thanks in advance,
Al Camp
I have a main form (frmMain) with a continuous subform (frmSubform). The
subform contains "disbursement" records against a frmMain form OrderAmt.
(basically... multiple subform entry of lengths of fabric vs. an OrderAmt).
When the Sum of subform disbursements (in a calculated field
[TotalDisbursed] in the subform footer) meets or exceeds the order amount,
that order has been "filled", and I lock (enabled = false) the subform from
any more disbursements.
My subform code keps track of the amounts disbursed as records are added,
and alerts the user that the disbursement is "incomplete", "complete", or
"over-disbursed" and... when applicable, moves the focus out of the subform,
and locks it. That all works fine.
Problem...
However, as the user browses between Main form records, I need to also
need to check this "status" and lock/unlock the subform accordingly. Some
orders are filled... some are not.
Using the Main form OnCurrent event... when I ask what the value of
TotalDisbursed is, there never seems to be a value. Seems as though the
Subform and Main haven't "connected" at that time. When the form comes up,
all the values are correct... but there appears to be no TotalDisbursed
value at OnCurrent time.
OnCurrent...
If Me![frmSubform].Form![TotalDisbursed] >= Me.OrderAmt Then...
'locking code
Else
'unlocking code
End If
Can anyone give me suggestions as to what's going on here, and how I
might be able to perform this OnCurrent checking?
Thanks in advance,
Al Camp