I'm trying to load two ListView controls with both listing the same entries, one ListView for tests to include and one for tests to exclude. Both the ListViews will only contain 1 column listing the tests.
I load a recordset from my table to be loaded into the ListViews with CheckBoxes enabled. My recordset contains the correct records (I checked) but when trying to add a record to the ListViews I get 'Runtime Error 13: Type mismatch' on the line in red:mad:
What am I missing/doing wrong? Can't even get it loaded which should be the easy part:eek:
My idea is when a test(s) is selected in one ListView to disable the same test in the other ListView as the same test can't be included and excluded at the same time.
I'm stumped. Any help will be appreciated.
I load a recordset from my table to be loaded into the ListViews with CheckBoxes enabled. My recordset contains the correct records (I checked) but when trying to add a record to the ListViews I get 'Runtime Error 13: Type mismatch' on the line in red:mad:
Code:
Dim itmXIn As ListItem
Dim itmXEx As ListItem
mySQL = "SELECT * FROM PRG_Options WHERE OPT_Section = 'Medical' AND OPT_Combo = 'TestType'"
rsTestType.Open mySQL, ADO_UserData, adOpenKeyset, adLockOptimistic
LvwInclude.ListItems.Clear
LvwExclude.ListItems.Clear
Do While Not rsTestType.EOF()
Set itmXin = LvwInclude.ListItems.Add(, , rsTestType("OPT_Option").Value)
Set itmXEx = LvwExclude.ListItems.Add(, , rsTestType("OPT_Option").Value)
rsTestType.MoveNext ' Move to next record.
Loop
rsTestType.Close
Set rsTestType = Nothing
Set itmXin = Nothing
Set itmXEx = Nothing
My idea is when a test(s) is selected in one ListView to disable the same test in the other ListView as the same test can't be included and excluded at the same time.
I'm stumped. Any help will be appreciated.