A atiaust Active Member Licensed User Longtime User Sep 16, 2016 #1 Hi All, I have a problem with a very simple If/Then statement which I can't explain and can only think it may be a bug. I know the value of row(4) is 1 Log("row 4 = "&Row(4)) ' log result = 'row 4 = 1' If Row(4) = 1 Then checkbox1.Checked = True Log("should now be checked") End If The checkbox doesn't get updated and the Log message "should now be checked" doesn't get shown in the logs.
Hi All, I have a problem with a very simple If/Then statement which I can't explain and can only think it may be a bug. I know the value of row(4) is 1 Log("row 4 = "&Row(4)) ' log result = 'row 4 = 1' If Row(4) = 1 Then checkbox1.Checked = True Log("should now be checked") End If The checkbox doesn't get updated and the Log message "should now be checked" doesn't get shown in the logs.
A atiaust Active Member Licensed User Longtime User Sep 16, 2016 #2 Solved. The value of Row(4) got converted to a string so the test for 1 doesn't work but "1" does.
Cableguy Expert Licensed User Longtime User Oct 1, 2016 #3 If you must check for an integer, than you must convert your value into one: dim rowvalue as int = row(4) then use rowvalue in your If statement
If you must check for an integer, than you must convert your value into one: dim rowvalue as int = row(4) then use rowvalue in your If statement