Private Sub xptFields_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
Select Case Index
Case CST_FLD_MASTER_CUSTOMERID
If KeyCode = vbKeyF4 Then
xptFields(Index).Tag = "1" '// Dont run Lost_Focus event
Call LookupCustomer
xptFields(Index).Tag = ""
KeyCode = 0
ElseIf KeyCode = vbKeyF2 Then
xptFields(Index).Tag = AddCustomer '// Dont run Lost_Focus event
If Val(xptFields(Index).Tag) > 0 Then
Call InitLookupData(enuLD_Customer)
xptFields(Index).Text = xptFields(Index).Tag
End If
xptFields(Index).Tag = ""
KeyCode = 0
End If
Case CST_FLD_MASTER_SALESORDERID
If KeyCode = vbKeyF4 Then
xptFields(Index).Tag = "1"
If LookupSalesOrder Then
If vsfGrid.Rows > 1 Then '// Data already in detail grid
If vbYes = MsgBox(MSG_DETAIL_REPLACEMENT_MESSAGE, vbYesNo + vbQuestion, MSG_HDR_APP) Then
GetSalesOrderDetail (mSalesOrderID)
End If
Else '// detail grid is empty
GetSalesOrderDetail (mSalesOrderID)
End If
End If
xptFields(Index).Tag = ""
KeyCode = 0
End If
End Select
End Sub