Filtering reference list options when adding new item

My website organizes articles by main topic and associated sub topics.

I have three collections; main topics, sub topics and articles. When adding a new article, I use two reference fields to connect it to a main topic and a sub topic. Is it possible to make the sub topic reference list show only the sub topics associated with the allready chosen main topic?