B4X:
If spnFirstName.SelectedIndex > 0 Then
Query = Query & "FirstName = '" & spnFirstName.SelectedItem & "' "
End If
SelectedFirstName = spnFirstName.SelectedIndex
B4X:
Query1 = "SELECT DISTINCT FirstName FROM persons"
Curs = Denek.SQL1.ExecQuery(Query1)
spnFirstName.Add("no filter")
'we fill the Spinner with the data from the database
For i = 0 To Curs.RowCount - 1
Curs.Position = i
spnFirstName.Add(Curs.GetString("FirstName"))
Next