I just want to get the right run id in a message box (well, it's the start of the process). I've added a button that calls the following function in Test Lab (this feature will work on the test instance details).


Sub ShowRunID
On Error Resume Next
HTMLFormat = TDConnection.IgnoreHtmlFormat
TDConnection.IgnoreHtmlFormat = True
Dim TheRunID
TheRunID = ""
TheRunID = Run_Fields("RN_RUN_ID").Value

msgbox TheRunID
End Sub

Like I said, I'm calling this function from a button. This works just fine until I change from one test set to another.
When clicking this button, I get the right run id on the message box, even if I change from one run to another on the dialog.
However, if I change to another test set, the run id gets messed up. The value I always get from that point is the last run id from the previous test set. Does not matter if I change back to the original test set, it still sends me the same run ID.

And this is what I tried:
Declared the run id var as public, and then set it to ="" on the testlab test set move to action - does not make a difference.
I've put another message box to see if there was any error coming, but nothing.
Instead of TheRunID = Run_Fields("RN_RUN_ID").Value I tried TheRunID = Run_Fields.Field("RN_RUN_ID").Value - also makes no difference

Anyone has a suggestion/comment about this?