I guess there's a first time for everything............ using the "Text" property to see what "change" is pending did the trick for this caper.
The App requires that when a payment field is deleted that a companion field containing a code also be visibly deleted. If one waits until the OnUpdate fires, one can certainly clear the companion field. BUT, the user won't see the companion deletion until they navigate away from the payment field which is unacceptable, hence the deletion has to have already been done.
Below are the OnChange and OnUpdate events that handle the situation.
Thanks John for the valuable lesson,
Bill
Code:
Private Sub tbCYP_Change()
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
'* With an change pending where the field has essentially been cleared, we also
'* need to clear the companion PC Code as well. If that's the case, we update the
'* current record and clear any existing code.
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
If Len(Me.tbCYP.Text & "") = 0 Then 'If poised to clear current payment
If Me.Dirty Then Me.Dirty = False 'Save the record now
Me.tbPCCode = Null 'Clear the any code appearing
End If
End Sub
Private Sub tbCYP_AfterUpdate()
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
'* Similar to the launch of Allen Browne's pop-up calendar adjacent to the date control,
' * we want to open the popup form from which a Per Capita code can be selected.
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
If Len(Me.PCCode & "") = 0 Then 'Don't know what it is... Null, Empty or zero length
lngCurRecID = Me.MemID 'Save current record ID. Popup needs global access.
If Me.Dirty Then Me.Dirty = False 'We need this record updated now
Me.tbPCCode.SetFocus 'Move to the PC Code box
Call ShowPCCodes
End If
End Sub