Examples: BeforeLineChange event

In this example, the BeforeLineChange event checks the value of the Markdown Amount field in the Invoice Entry grid. If the user attempts to enter a markdown amount greater than 20%, the KeepFocus parameter stops the line change event, and moves the focus back to the current line:

Private Sub Grid_BeforeLineChange(KeepFocus As Boolean)
	If CCur(MarkdownAmount) > CCur(UnitPrice) * 0.2 Then
		'The markdown was greater than 20%
		KeepFocus = True
		MsgBox "You cannot enter a markdown greater than 20% " + _ 
		"of the unit price."
	End If
End Sub

Documentation Feedback