I've encountered a strange problem with the Table control. I want to be able to place a checkmark next to 2 items for a later comparison of items. I have a first column named "X" which, when clicked, will result in an X being placed in the "X" column for the selected row. I want to be able to undo the "X" if it is clicked a second time. A global variable counter limits the number of checked items to two. The checking and unchecking is done within a Table1_SelectionChanged subroutine. This Sub has two IF blocks: one for checking and one for unchecking. The checking IF block works fine, but the code in the unchecking IF block does not work (nothing happens). There are two oddities:
(1) If I change the statement
Table1.Cell("X",Table1.SelectedRow) = ""
to any character other than "" the code works (e.g.,Table1.Cell("X",Table1.SelectedRow) = "O").
(2) If I put the IF block unchecking code in a separate subroutine for Button1_Click, the code works just fine.
This has got me stumped. Am I missing something obvious, or is there a bug here? Source code is attached.
(1) If I change the statement
Table1.Cell("X",Table1.SelectedRow) = ""
to any character other than "" the code works (e.g.,Table1.Cell("X",Table1.SelectedRow) = "O").
(2) If I put the IF block unchecking code in a separate subroutine for Button1_Click, the code works just fine.
This has got me stumped. Am I missing something obvious, or is there a bug here? Source code is attached.