How do i, Set the focus to the first field – Kofax DOKuStar Validation User Manual

Page 110

Advertising
background image

DOKuStar Validation Programming Manual

Page

106

How Do I…

Set the Focus to the First Field

You might want to set the focus in the Validation GUI to the first field after importing the data. This is done using
the field’s

Activate

method. The first field should be identified with respect to the current filter settings, so we use

the cursor object.

The following piece of code sets the focus to the first field right after the

Data

object has been filled:

Option Explicit
Dim WithEvents Data As DOKuStarDataset.Data

Private Sub Application_OnProjectLoaded(ByVal App As Application)
Set Data = App.Project.DataSet.Data
End Sub

Private Sub Data_OnPostImported(ByVal Data As Data)
Dim crs As Cursor

Set crs = Data.DataSet.Controller.Cursor '* get the current cursor
If crs.Fields.Count = 0 Then
MsgBox "No fields correspond to the current filter settings"
Exit Sub
End If
crs.FirstField.Activate '* activate the first field

End Sub

Advertising