I tried using CHECKLISTITEM with the key field from the file I was working in and it wouldn't work.
The key field was a string, and the field has alpha and numeric characters. The lists that were built in the session variables were comma seperated lists, but didn't have quotes around the key value. This caused errors with SQL.
I tried building a field that had the quotes around the text value and using that, but then the lists were completely empty.
I have worked around this by adding an identity column to the table, but would like to fix the code and remove the extra column.