LOCAL llAdded, ;
lcDisplayValue
IF tsifCombo::Valid() AND this.Enabled
this.Refresh()
IF EMPTY(this.Value) AND !EMPTY(this.DisplayValue) AND THIS.DisplayValue # CHR(12) AND THIS.DisplayValue # 'E'
*-- Prompt user to add the new customer
IF MESSAGEBOX(ADDCUSTOMER_LOC, ;
MB_ICONQUESTION + MB_YESNO, ;
TASTRADE_LOC) = IDNO
RETURN .F.
ENDIF
*-- Add the new customer
lcDisplayValue = this.DisplayValue
DO FORM custadd WITH this.DisplayValue TO llAdded
*-- llAdded will be .T. if user pressed OK
IF llAdded
*-- Add the customer to the combobox
this.Requery()
this.DisplayValue = lcDisplayValue
*-- Position the record pointer in the customer table
=SEEK(this.Value, "customer", "customer_i")
THISFORM.txtAvailCredit.Value = RemainingCredit(THIS.Value)
thisform.RefreshCustomerInfo()
ELSE
this.DisplayValue = ""
RETURN .F.
ENDIF
ENDIF
ENDIF