LOCAL lcCustomerID, ;
lnOldArea
IF EMPTY(thisform.cboCustomer_ID.Value) OR ;
EMPTY(thisform.cboCustomer_ID.DisplayValue)
=MESSAGEBOX(SELCUSTFIRST_LOC, ;
MB_ICONEXCLAMATION, ;
TASTRADE_LOC)
thisform.cboCustomer_ID.SetFocus()
RETURN
ENDIF
*-- Make sure customer has a prior order
lnOldArea = SELECT()
lcCustomerID = orders.customer_id
USE ORDERS IN 0 AGAIN ALIAS orders_temp
SELECT orders_temp
COUNT FOR customer_id = lcCustomerID
USE
SELECT (lnOldArea)
IF _tally = 0
=MESSAGEBOX(NOLASTORDER_LOC, ;
MB_ICONEXCLAMATION, ;
TASTRADE_LOC)
ELSE
thisform.Closable = .F.
this.Enabled = .F.
thisform.lAllowEdits = .F.
thisform.lAllowNew = .F.
thisform.cboCustomer_ID.Enabled = .F.
thisform.RefreshForm()
oApp.DoForm("ordhist", thisform)
ENDIF