SQLite - combobox and SelectionChanged

Merlot2309

Active Member
Licensed User
Longtime User
Hello Klaus and others,

More info about not getting the correct value from SQLite table 1 with Selectionchanged:
SQLite table 1: 3 columns -> Id - A - B
SQLite table 2: x columns -> Id - A - B - C - D

Table 2 column D should display the records that match Table 1 - column B
No matter what I try; the index from SQLite table 1 gets selected, while I need the id.

Sub cbFam_SelectionChanged (id, Value)
Main.Input1.Clear 'The form with the ComboBox to be filled
Fam = id +1 ' The index of the SQLite table is minus one

FamConn.Open("Data Source = " & AppPath & "\Wn.sql")
FamComm.AddParameter("Fam")
FamComm.SetParameter("Fam", Fam)

FamComm.CommandText = "Select B FROM Table2 WHERE D = @Fam"

FamReader.Value = FamComm.ExecuteReader
Do While FamReader.ReadNextRow = True
Main.Input1.Add(FamReader.GetValue(0))
Loop

Thanks in advance,

Helen.
 

Merlot2309

Active Member
Licensed User
Longtime User
Hello and excuses for my bad explanation (trauma :eek:)

Another try:
SQLite Table "Familie":
Display all records of column "FamNL" in Combobox A

On the SelectionChanged of 1 record in ComboBox A all the records of Table "Gegevens", column "Famnr" that match Table "Familie" should be displayed in ComboBox B.

No matter what I try, the Index of table "Familie" is picked up, while the value of column "FamNr" should be picked up.

When I change the value of ComboBox A to "FamNr" it functions fine, but a number doesn't give much info to the user.

Please let me know if I forgot to mention info needed to trigger this.

Thank you!

Helen.
 
Top