In the following example, the AfterLineGotFocus event checks the value of the Item Number field in the Invoice Entry grid. If the field is empty, the procedure opens the Items lookup window:
Private Sub Grid_AfterLineGotFocus() If ItemNumber.Empty = True Then 'Open the lookup window InvoiceEntry.LookupButton6 = 1 End If End Sub