Examples: FocusSeg method


The following example sets an account number segment from “outside” the Account field (using the Checkbook ID field’s AfterUserChanged event). The procedure moves the focus to the Account field, then sets the first segment using the FocusSeg method:

Private Sub CheckbookID_AfterUserChanged()
	'Move to the Account field and set the first segment
	Account.FocusSeg (1), "100"
End Sub

The following example sets account segments from “inside” the Account field. In this case, the Account field already has the focus. The ValueSeg property sets the first two segment values. The FocusSeg method then moves the focus to the third segment:

Private Sub CashAccount_AfterGotFocus()
	If CheckbookID = "PAYROLL" Then
		'Set default payroll account segments
		CashAccount.ValueSeg(1) = "100"
		CashAccount.ValueSeg(2) = "1500"
		'Move the focus to the third segment
		CashAccount.FocusSeg(3)
	End If
End Sub


Documentation Feedback