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.
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.