Examples: BeforeLostFocus event

In the following example, the BeforeLostFocus event procedure runs for the Number field (document number) in the Receivables Transaction Entry window. Normally, the Microsoft Dynamics GP lost focus event locks this field. In this case, the procedure cancels subsequent lost focus events, and the Number field remains unlocked and editable:

Private Sub Number_BeforeLostFocus(KeepFocus As Boolean, _ 
CancelLogic As Boolean)
	CancelLogic = True
	'Move the focus to the next field
	Description.Focus = True
End Sub

Documentation Feedback